Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Taskbar height

Posted on 1999-07-14
11
Medium Priority
?
963 Views
Last Modified: 2010-05-18
Using Delphi 3 Pro

How can I get the height of the Windows taskbar so that I can make my forms scale and still leave the task bar visible ?

Thanks
0
Comment
Question by:nohj
[X]
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
  • 4
  • 2
  • 2
  • +3
11 Comments
 
LVL 2

Accepted Solution

by:
kotik earned 300 total points
ID: 1388508
Hi, nohj!
This is what I found in Win32 Help:
The work area is the portion of the screen not obscured by the taskbar. To retrieve the size of the work area, call the SystemParametersInfo function with SPI_GETWORKAREA. To retrieve the rectangle coordinates that describe the location of the taskbar, use the ABM_GETTASKBARPOS message.
0
 
LVL 2

Expert Comment

by:kotik
ID: 1388509
Tell me if you have difficulties in implementing that.
0
 
LVL 7

Expert Comment

by:RBertora
ID: 1388510
I think Kotik is correct, I think that the only way to resize the task bar is by generating the onmouse drag event, you cannot simply set the properties, I tried this but failed.

bert.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 13

Expert Comment

by:Epsylon
ID: 1388511
Well, here it is:


procedure TForm1.Button1Click(Sender: TObject);
var
  r : TRect;
begin
  SystemParametersInfo(SPI_GETWORKAREA,
                       0,
                       @r,
                       0);
  ShowMessage(IntToStr(r.Bottom - r.Top));
end;

0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1388512
But I think it is easier to set Form1.WindowsState to swMaximized. Now you don't have to worry about anything

Cheers,

Epsylon.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1388513
Of course I mean wsMaximized....   :o)
0
 
LVL 2

Expert Comment

by:CalvinDay
ID: 1388514
This is a definative way of getting the dimensions of the task bar.

procedure TForm1.Button1Click(Sender: TObject);
var
   wnd:HWND;
   Rct:TRect;
begin
   Wnd:=FindWindow('Shell_TrayWnd', nil);
   GetWindowRect(Wnd,Rct);
   ShowMessage('Rect is:'+#10+#13+
   ' Left='+IntToStr(rct.left)+#10+#13+
   ' Top='+IntToStr(rct.top)+#10+#13+
   ' Bottom='+IntToStr(rct.Bottom)+#10+#13+
   ' Right='+IntToStr(rct.Right));
end;

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388515
hi all,

one remark, if allowed,
the taskbar can also be on the side or on the top, not only on the bottom.

meikl
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1388516
hi again,

an additional remark, if allowed,
eps is right to maximize the form,
this do never hide a standing taskbar.

meikl
0
 

Author Comment

by:nohj
ID: 1388517
I used

SystemParametersInfo(SPI_GETWORKAREA,0,@WinRect,0);

WinRect is a TRect;

Thanks
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1388518
Strange.....
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

670 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