Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages
Started by Liu Shan
Wed, 20 Sep 2006 03:10
how to get the height of the taskbar using BCB
Author: Liu Shan
Date: Wed, 20 Sep 2006 03:10
Date: Wed, 20 Sep 2006 03:10
8 lines
1161 bytes
1161 bytes
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.
Re: how to get the height of the taskbar using BCB
Author: Remy Lebeau (TeamB)
Date: Wed, 20 Sep 2006 03:51
Date: Wed, 20 Sep 2006 03:51
37 lines
2165 bytes
2165 bytes
"Liu Shan" <liushan@ps-electronic.com> wrote in message
news:4510b10b$1@newsgroups.borland.com...
> 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 ...
> 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
Re: how to get the height of the taskbar using BCB
Author: Liu Shan
Date: Wed, 20 Sep 2006 07:42
Date: Wed, 20 Sep 2006 07:42
2 lines
998 bytes
998 bytes
Very thanks.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads