Results 1 to 7 of 7

Thread: [RESOLVED] Getting Taskbar Attributes...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    30

    Resolved [RESOLVED] Getting Taskbar Attributes...

    I've come to a point in my application where it would help me out to know how to get the attributes of the user's windows taskbar (height in particular)

    I want to make alert messages such as those found in AIM, Outlook, and a ton of other programs that you may have noticed. It is just a little form that slides up and fades away.

    I do not want to take it for granted how "tall" a user's taskbar is because I know I have my taskbar doubled in size as I like to have my quick launch bar run along the bottom. Most people I could assume have it set to the normal size, but this won't be a good assumption in the long run I am sure.

    Any takers? :-)

  2. #2
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: Getting Taskbar Attributes...

    3 hints

    1) VbPixels @ Scalemode
    2) An API
    3) Screen.Height

    To help ya on your way

    VB Code:
    1. Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
    2.  
    3. Private Const SPI_GETWORKAREA As Long = 48
    4.  
    5. Private Type RECT
    6.     lLeft As Long
    7.     lTop As Long
    8.     lRight As Long
    9.     lBottom As Long
    10. End Type
    11.  
    12. Private tScreen As RECT
    13.  
    14. Public Function GetTaskBarHeight() As Integer
    15.     Call SystemParametersInfo(SPI_GETWORKAREA, 0, tScreen, 0)
    16.  
    17.     tScreen.lLeft = tScreen.lLeft * Screen.TwipsPerPixelX
    18.     tScreen.lRight = tScreen.lRight * Screen.TwipsPerPixelX
    19.     tScreen.lTop = tScreen.lTop * Screen.TwipsPerPixelY
    20.     tScreen.lBottom = tScreen.lBottom * Screen.TwipsPerPixelY
    21.  
    22.     GetTaskBarHeight = Screen.Height - tScreen.lBottom
    23.  
    24. End Function

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    30

    Re: Getting Taskbar Attributes...

    Devion... buy ya a beer?

    Worked flawlessly.

    Now I can end my sliding form RIGHT at the top edge of the taskbar like I wanted!

    Thank you very much, buddy!

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Getting Taskbar Attributes...

    Quote Originally Posted by joshjoneswas
    I want to make alert messages such as those found in AIM, Outlook, and a ton of other programs that you may have noticed. It is just a little form that slides up and fades away.
    You need Wokawidget's excellent Component Suite, which, among other things, contains a MSN-messenger style notifications DLL (It also contains an MSN client )

  5. #5
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: Getting Taskbar Attributes...

    Feel free to send any beer, then again.. I'd do for just a simple Rep add

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    30

    Re: Getting Taskbar Attributes...

    Penagate: I had no idea that existed although a friend was telling me about some classes he wrote that would do the job... although not nearly as GREAT looking as Wokawidgets' !

    Devion: I'm the new kid to the forum. Tried spreading ya some love.. but I just can't I suppose.

    Thanks again to both of you!

  7. #7
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: [RESOLVED] Getting Taskbar Attributes...

    Haha, no prob m8

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width