|
-
May 30th, 2007, 09:45 AM
#1
Thread Starter
Member
[RESOLVED] Getting Taskbar Properties
Is there anyway to get the taskbar properties, such as height or autohide properties?
I need to have a particular window flush against the taskbar if it's multiple rows tall or all the way to the bottom of the screen if its set to autohide.
Thanks.
-
May 30th, 2007, 09:50 AM
#2
Re: Getting Taskbar Properties
Does this help?
Code:
Private Declare Function AppBarMessage Lib "shell32.dll" Alias "SHAppBarMessage" _
(ByVal dwMessage As Long, pData As APPBARDATA) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type APPBARDATA
cbSize As Long
hwnd As Long
uCallbackMessage As Long
uEdge As Long
rc As RECT
lParam As Long ' message specific
End Type
Private BarData As APPBARDATA
Private MyPos As String
Private Const ABM_GETTASKBARPOS As Long = &H5&
Private Sub GetTaskBarPos()
Dim WhereAmI As Long
BarData.cbSize = Len(BarData)
WhereAmI = AppBarMessage(ABM_GETTASKBARPOS, BarData)
MyPos = "Top = " & BarData.rc.Top & vbCrLf 'contains top most position
MyPos = MyPos & "Bottom = " & BarData.rc.Bottom & vbCrLf 'contains bottom most position
MyPos = MyPos & "Left = " & BarData.rc.Left & vbCrLf 'contains far left position
MyPos = MyPos & "Right = " & BarData.rc.Right & vbCrLf 'contains far right position
MsgBox MyPos
End Sug
-
May 30th, 2007, 10:33 AM
#3
Re: Getting Taskbar Properties
-
May 30th, 2007, 10:41 AM
#4
Thread Starter
Member
Re: Getting Taskbar Properties
Almost. If the bar's not on autohide I can size the window accordingly, positioning it with the a difference of the taskbar's height. But if the taskbar is on autohide, I am still getting it's height and this there's always a space between the bottom of the screen and my window.
Do you know anyway I can get the autohide boolean property?
-
May 30th, 2007, 11:02 AM
#5
Re: Getting Taskbar Properties
Add this into Hack's code after WhereAmI = AppBarMessage(ABM_GETTASKBARPOS, BarData) line.
Code:
Dim IsTaskbarAutoHideOn As Boolean
IsTaskbarAutoHideOn = AppBarMessage(ABM_GETSTATE, BarData) And ABS_AUTOHIDE
Declarations:
Code:
Private Const ABM_GETSTATE As Long = &H4
Private Const ABS_AUTOHIDE As Long = &H1
-
May 30th, 2007, 11:52 AM
#6
Thread Starter
Member
Re: Getting Taskbar Properties
Thanks! Everything works flawlessly now. Thanks to everyone for your input and help.
Cheers.
-
May 30th, 2007, 11:55 AM
#7
Re: Getting Taskbar Properties
 Originally Posted by iPrank
Add this into Hack's code after WhereAmI = AppBarMessage(ABM_GETTASKBARPOS, BarData) line.
Code:
Dim IsTaskbarAutoHideOn As Boolean
IsTaskbarAutoHideOn = AppBarMessage(ABM_GETSTATE, BarData) And ABS_AUTOHIDE
Declarations:
Code:
Private Const ABM_GETSTATE As Long = &H4
Private Const ABS_AUTOHIDE As Long = &H1
Nice one iPrank!
-
May 30th, 2007, 01:19 PM
#8
Re: [RESOLVED] Getting Taskbar Properties
LOL ! Two times, last rep points I needed for another jewel, came from you. 
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|