Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 332
  • Last Modified:

determine if taskbar is present and height

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
isnoend2001
Asked:
isnoend2001
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
"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
 
isnoend2001Author Commented:
Thank you
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now