Taskbar height?

BlitzMax Forums/MaxGUI Module/Taskbar height?

Leon Drake(Posted 2007) [#1]
Any idea on how to either

A.)Get the Height of the desktop - the users Taskbar height

or

B.) Simply get the height of the user's taskbar

?


Leon Drake(Posted 2007) [#2]
hwnd = FindWindow("Shell_traywnd", "")

doesnt seem to return anything


Leon Drake(Posted 2007) [#3]
hmm nvm it is returning a handle but its crashing if i try to use the handle returned in a gadgetheight() func.


but it returns the rect in GetWindowRect( hWnd,lpRect:Byte Ptr )

function so har har i figured it out and stuff. Maybe someone can find this useful


Leon Drake(Posted 2007) [#4]
Ok i might as well give you the code on how i got the info

'true client height of desktop

Type lpRECT
	Field l, t, r, b
End Type

local taskrect:lpRect = New lpRECT
hwnd = FindWindow("Shell_traywnd", "")
GetWindowRect( hwnd,taskrect )

local tasksize = taskrect.b - taskrect.t

local trueclientheight = GadgetHeight(Desktop()) - tasksize




dan_upright(Posted 2007) [#5]
dunno if it's still useful to you, but i might as well post it - how to get the desktop area (minus taskbar)

Const SPI_GETWORKAREA:Int = 48

Extern "Win32"
	Function SystemParametersInfoA:Int(action:Int, param:Int, param2:Byte Ptr, winini:Int)
EndExtern

Function GetDesktopArea(lpRect:Int Ptr)

	SystemParametersInfoA(SPI_GETWORKAREA, 0, lpRect, 0)

End Function

Local deskRect:Int[4]

GetDesktopArea(deskRect)

Print "Desktop area: " + deskRect[0] + ", " + deskRect[1] + " -> " + deskRect[2] + ", " + deskRect[3]



Leon Drake(Posted 2007) [#6]
ah cool thats another good way as well.


TAS(Posted 2012) [#7]
Works great!