BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to get the height of the taskbar using BCB

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Liu Shan
Guest





PostPosted: Wed Sep 20, 2006 8:10 am    Post subject: how to get the height of the taskbar using BCB Reply with quote



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





PostPosted: Wed Sep 20, 2006 8:10 am    Post subject: Re: how to get the height of the taskbar using BCB Reply with quote



Very thanks.
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Sep 20, 2006 8:10 am    Post subject: Re: how to get the height of the taskbar using BCB Reply with quote



"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.