?
Solved

determine if taskbar is present and height

Posted on 2009-04-14
2
Medium Priority
?
319 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
[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
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

719 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