How to obtain taskbar pos & size

Posted on 1997-05-04
Last Modified: 2010-04-06
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.
Question by:mlanza
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Author Comment

ID: 1335886
Edited text of question

Expert Comment

ID: 1335887
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...

Accepted Solution

lkovac earned 20 total points
ID: 1335888
  r: TRect;
  h: hWnd;
  h := FindWindow("TrayNotifyWnd", "");
  if h <> 0 then
    GetWindowRect(h, r);

Author Comment

ID: 1335889
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.


Expert Comment

ID: 1335890
Sorry, here is the correct, tested code:

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


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tviruailstringtree sort multi columns on header click 1 96
Graphics32 under Delphi 10.1 Berlin 2 181
Tvertscrollbox like a whatsapp layout 5 68
IP without any Dots 1 99
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below.…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question