안녕하세요.
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 (...)
{
}
}
|