 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Liu Shan Guest
|
Posted: Wed Sep 20, 2006 8:10 am Post subject: how to get the height of the taskbar using BCB |
|
|
Hi, Guys,
Does somebody know how to get the height of the taskbar using BCB? Because I
need to arrange a few windows on window screen, need to calculate the
window's height to void overlapping taskbar. which function can call to get
the height of the taskbar?
Thanks a lot. |
|
| Back to top |
|
 |
Liu Shan Guest
|
Posted: Wed Sep 20, 2006 8:10 am Post subject: Re: how to get the height of the taskbar using BCB |
|
|
Very thanks. |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Sep 20, 2006 8:10 am Post subject: Re: how to get the height of the taskbar using BCB |
|
|
"Liu Shan" <liushan@ps-electronic.com> wrote in message
news:4510b10b$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Does somebody know how to get the height of the taskbar using BCB?
|
APPBARDATA abd = {sizeof(APPBARDATA), 0};
abd.hWnd = FindWindow("Shell_TrayWnd", NULL);
if( SHAppBarMessage(ABM_GETTASKBARPOS, &abd) )
// use abd.rc as needed ...
Alternatively:
RECT r = {0};
HWND hWnd = FindWindow("Shell_TrayWnd", NULL);
GetWindowRect(hWnd);
// use r as needed ...
| Quote: | I need to arrange a few windows on window screen, need to
calculate the window's height to void overlapping taskbar. which
function can call to get the height of the taskbar?
|
You are not taking into account that the Taskbar can be on the side of the
screen instead of the top or bottom, or that the Taskbar can be hidden when
not used. You should instead be using SystemParametersInfo() to get the
work area of the desktop. Then you don't have to care about the Taskbar at
all. For example:
RECT r = {0};
if( SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0) )
{
// position the windows within the bounds of the RECT as needed ...
}
Gambit |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|