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.
Printable View
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.
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
SPI_GETWORKAREA may work too.
http://www.vb-helper.com/howto_center_form.html
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?
Add this into Hack's code after WhereAmI = AppBarMessage(ABM_GETTASKBARPOS, BarData) line.
Declarations:Code:Dim IsTaskbarAutoHideOn As Boolean
IsTaskbarAutoHideOn = AppBarMessage(ABM_GETSTATE, BarData) And ABS_AUTOHIDE
Code:Private Const ABM_GETSTATE As Long = &H4
Private Const ABS_AUTOHIDE As Long = &H1
Thanks! Everything works flawlessly now. Thanks to everyone for your input and help.
Cheers.
:thumb: Nice one iPrank!Quote:
Originally Posted by iPrank
LOL ! Two times, last rep points I needed for another jewel, came from you. :lol:
Thanks. :)