Главная страница | назад





Article #17397: How do I find the size of the Desktop minus the taskbar?

 Question and Answer Database
FAQ2397C.txt How do I find the size of the Desktop minus the taskbar?
Category :Windows API
Platform :All
Product :C++Builder 3.x
Question:
How do I find the size of the Desktop minus the taskbar?
Answer:
Call the Windows API function SystemParametersInfo() passing
the SPI_GETWORKAREA parameter along with the address of the rectangle
structure to receive the coordinates.
Example:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TRect r ;
SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
Memo1->Lines->Add(IntToStr(r.Top));
Memo1->Lines->Add(IntToStr(r.Left));
Memo1->Lines->Add(IntToStr(r.Bottom));
Memo1->Lines->Add(IntToStr(r.Right));
}
7/2/98 10:32:32 AM

Last Modified: 01-SEP-99