Solved

determine if taskbar is present and height

Posted on 2009-04-14
2
260 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 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

14 Experts available now in Live!

Get 1:1 Help Now