Solved

determine if taskbar is present and height

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 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