How to obtain taskbar pos & size

The screen object provides full screen width & height dimensions that do not take into account the position and size of the Win95 taskbar.

How do I find out about the positon and size of the Win95 taskbar ?

I've been looking in the Win32 help file for a few days now and can't find the answer.
mlanzaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
lkovacConnect With a Mentor Commented:
var
  r: TRect;
  h: hWnd;
...
  h := FindWindow("TrayNotifyWnd", "");
  if h <> 0 then
    GetWindowRect(h, r);
0
 
mlanzaAuthor Commented:
Edited text of question
0
 
gysbert1Commented:
I seem to remember that there is a handle for the desktop, which
should take into account the taskbar, and subtract it from the screens size. I'll look into it and get back to you...
0
 
mlanzaAuthor Commented:
The answer is incorrect, FindWindow('TrayNotifyWnd', Nil) always returns no window handle.

Please also note that I am after the TaskBar, not just the Notify Icon area.

0
 
lkovacCommented:
Sorry, here is the correct, tested code:

var
  r: TRect;
  h: hWnd;
begin
  h := FindWindow('Shell_TrayWnd', '');
  if h <> 0 then
    GetWindowRect(h, r);
end;

0
All Courses

From novice to tech pro — start learning today.