void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
    TRegistry *regKey = new TRegistry;
        regKey->RootKey = HKEY_CURRENT_USER;
        regKey->OpenKey("NoticeMe", true);
        regKey->WriteInteger("Left", Left);
        regKey->WriteInteger("Top", Top);
        regKey->CloseKey();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
    TRegistry *regKey = new TRegistry;

    regKey->RootKey = HKEY_CURRENT_USER;
    regKey->OpenKey("NoticeMe", true);

    Left = regKey->ReadInteger("Left");
    Top  = regKey->ReadInteger("Top");

        regKey->CloseKey();
}

kenny23 發表在 痞客邦 PIXNET 留言(0) 人氣()