C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[184] [질문] 빌더 - 레지스트리의 저장과 읽기.../프포
dreamsys [ ] 6747 읽음    1998-03-01 18:40
안녕하세요.
COLOR의 자료형을 String에서 COLORREF로 바꾸어도 에러가 납니다.
어떻게 해야죠?
참고로, 레지스트리의 저장과 읽기에 대하여...
그럼.

void __fastcall TMainForm::FormClose(TObject *Sender, TCloseAction &Action)
{
Registry->WriteInteger("Left", Left);
Registry->WriteInteger("Top", Top);
Registry->WriteInteger("Height", Height);
Registry->WriteInteger("Width", Width);
Registry->WriteInteger("Color",RichEdit1->Color);
Registry->WriteInteger("ColorFont", RichEdit1->Font->Color);
Registry->WriteString("WindowState", WindowState);
Registry->Free();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::FormShow(TObject *Sender)
{
    int iLeft, iTop, iHeight, iWidth;
    COLORREF iColor, iColorFont;
    String iWinState;

    Registry = new TRegistry;
    Registry->RootKey = HKEY_LOCAL_MACHINE;
    Registry->OpenKey("SOFTWARE\\SnbrSoft", TRUE);

    try
    {
        iLeft      = Registry->ReadInteger("Left");
        iTop       = Registry->ReadInteger("Top");
        iHeight    = Registry->ReadInteger("Height");
        iWidth     = Registry->ReadInteger("Width");
        iColor     = Registry->ReadInteger("Color");
        iColorFont = Registry->ReadInteger("ColorFont");
        iWinState  = Registry->ReadString("WindowState");

        switch(iWinState)
        {
                case wsMinimized : WindowState = wsMaximized; break;
            case wsNormal : WindowState = wsNormal;
                                Left = iLeft;
                                Top = iTop;
                                Height = iHeight - 5;
                                Width = iWidth - 5;
                                break;
            case wsMaximized : WindowState = wsMaximized; break;
        }
        RichEdit1->Color = iColor;
        RichEdit1->Font->Color = iColorFont;
    }
    catch (...)
    {
    }

}


+ -

관련 글 리스트
184 [질문] 빌더 - 레지스트리의 저장과 읽기.../프포 dreamsys 6747 1998/03/01
186     [답변] DREAMSYS/ 빌더 - 레지스트리의 저장과 읽기.../프포 드림빌더 6462 1998/03/01
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.