Board index » cppbuilder » TForm->Position..storing values into Registry..

TForm->Position..storing values into Registry..


2004-05-26 08:34:58 AM
cppbuilder14
hi dear builders,
i got a question about TForm->Left and TForm->Top..
i'm storing these values in the Registry to load them again when
the programm gets executed..
BUT i would like to avoid storing the values when the Form is out of
the screen...how can i handle this ?? i even don't know the resolution that
the user has..so how can i check if the Form is not out of the screen ??
Oren
this is what i'm using now..(works pretty fine..)
/*********************************************/
void Store_FormPos()
{
TRegistry* reg = new TRegistry;
try
{
reg->OpenKey(RegistryKey, true);
reg->WriteInteger("FormPos_Left", Form1->Left);
reg->WriteInteger("FormPos_Top", Form1->Top);
reg->WriteInteger("FormSize_Width", Form1->Width);
reg->WriteInteger("FormSize_Height", Form1->Height);
reg->CloseKey();
}
__finally {delete reg;}
}
/*********************************************/
 
 

Re:TForm->Position..storing values into Registry..

"Oren Halvani" < XXXX@XXXXX.COM >wrote in message
Quote
BUT i would like to avoid storing the values when the Form is
out of the screen...how can i handle this ?? i even don't know
the resolution that the user has..so how can i check if the Form
is not out of the screen ??
Look at the global Screen object. It has Width and Height properties that
specify the current screen dimensions. You can compare the form's
positioning against those values.
Gambit
 

Re:TForm->Position..storing values into Registry..

"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >schrieb im
Newsbeitrag news: XXXX@XXXXX.COM ...
Quote

Look at the global Screen object. It has Width and Height properties that
specify the current screen dimensions. You can compare the form's
positioning against those values.

Gambit
thanks Remy..i'll take a look on it...
Oren
 

{smallsort}