Solved

determine if taskbar is present and height

Posted on 2009-04-14
2
270 Views
Last Modified: 2012-05-06
How can I determine that a taskbar is present. Also, how
do I determine the height of the taskbar. I am programatically sizing
windows and so need to know how much space I have.
0
Comment
Question by:isnoend2001
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 24144583
"I am programatically sizing windows and so need to know how much space I have."

Sounds like you need to know the "working area" of the desktop:
http://msdn.microsoft.com/en-us/library/ms724947.aspx

    "SPI_GETWORKAREA - Retrieves the size of the work area on the primary display monitor. The work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars."

Simple example:
Private Type RECT

    Left As Long

    Top As Long

    Right As Long

    Bottom As Long

End Type
 

Private Declare Function SystemParametersInfo Lib "user32" _

    Alias "SystemParametersInfoA" (ByVal uAction As Long, _

    ByVal uParam As Long, ByRef lpvParam As Any, _

    ByVal fuWinIni As Long) As Long
 

Private Const SPI_GETWORKAREA = 48
 

Private desktopRect As RECT
 

Private Sub Form_Load()

    Call SystemParametersInfo(SPI_GETWORKAREA, vbNull, desktopRect, 0)

    ' ...now you can use the values from "desktopRect" to figure out where to place/size your form...

End Sub

Open in new window

0
 

Author Closing Comment

by:isnoend2001
ID: 31570229
Thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now