Rad Posted September 22, 2007 Share Posted September 22, 2007 Is there any way to get the width/height of the actual desktop, excluding the taskbar and sidebar(s)? If you maximize a window they seem to know how big to become, but when you make a window that has @desktowidth // height as its size its fullscreen basically. I could just subtract the width of the two, but I've done that before and it doesn't work right on someone elses computer (It's not dynamic) There should be a way I saw the helpfile mentioning WinGetClientSize("Program Manager"), but it still returns 1280x1024 (It should be around 1120x1000...ish) kthx Link to comment Share on other sites More sharing options...
BrettF Posted September 22, 2007 Share Posted September 22, 2007 Is there any way to get the width/height of the actual desktop, excluding the taskbar and sidebar(s)?If you maximize a window they seem to know how big to become, but when you make a window that has @desktowidth // height as its size its fullscreen basically.I could just subtract the width of the two, but I've done that before and it doesn't work right on someone elses computer (It's not dynamic)There should be a way I saw the helpfile mentioning WinGetClientSize("Program Manager"), but it still returns 1280x1024 (It should be around 1120x1000...ish)kthxA rather crude method would be to create a hidden window that has been maximised and then get the size of it. But like I said, that is crude. I'm pretty sure there is a better way somewhere. Have you tried searching the forums? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Rad Posted September 22, 2007 Author Share Posted September 22, 2007 (edited) I've searched for this before too though. Usually finding a simple question can be harder than finding a more difficult one, though... I have a hard time finding what I'm searching for on these forums though. Especially when it something that wouldn't be very common. At least, I don't think this would be. Not to mention I just suck at searching here, lol. ~Example, it took me nearly an hour to find that "Wake On Lan" script because I didn't know what keywords to use. That was awhile ago... quite awhile ago... Oh, and Ill just use the hidden window idea for now, but if theres an easier way it'd be nice to know. Edited September 22, 2007 by Rad Link to comment Share on other sites More sharing options...
frostfel Posted September 22, 2007 Share Posted September 22, 2007 Is there any way to get the width/height of the actual desktop, excluding the taskbar and sidebar(s)?If you maximize a window they seem to know how big to become, but when you make a window that has @desktowidth // height as its size its fullscreen basically.I could just subtract the width of the two, but I've done that before and it doesn't work right on someone elses computer (It's not dynamic)There should be a way I saw the helpfile mentioning WinGetClientSize("Program Manager"), but it still returns 1280x1024 (It should be around 1120x1000...ish)kthxYou were close just using wrong command WinGetPos returns the width and hight. WinGetClientSize returns client size$DeskSize = WinGetPos("Program Manager")MsgBox(0, "Size", "The Desktop is Width:"&$DeskSize[2]&" Hight:"&$DeskSize[3]) Link to comment Share on other sites More sharing options...
martin Posted September 22, 2007 Share Posted September 22, 2007 You were close just using wrong command WinGetPos returns the width and hight. WinGetClientSize returns client size$DeskSize = WinGetPos("Program Manager")MsgBox(0, "Size", "The Desktop is Width:"&$DeskSize[2]&" Hight:"&$DeskSize[3])If you have a task bar at the top of your screen then the DeskSize[1] value will still be 0, and if you have a task bar at the left of your screen then DeskSIze[0] will still be 0. If this matters then the following method posted by Siao is the way to go;=============================================================================== ; ; Function Name: _GetWorkingArea() ; Description: Returns the coordinates of desktop working area rectangle ; Parameter(s): None ; Return Value(s): On Success - Array containing coordinates: ; $a[0] = left ; $a[1] = top ; $a[2] = right ; $a[3] = bottom ; On Failure - 0 ; ;=============================================================================== Func _GetWorkingArea() #cs BOOL WINAPI SystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni); uiAction SPI_GETWORKAREA = 48 #ce Local $dRECT = DllStructCreate("long; long; long; long") Local $spiRet = DllCall("User32.dll", "int", "SystemParametersInfo", _ "uint", 48, "uint", 0, "ptr", DllStructGetPtr($dRECT), "uint", 0) If @error Then Return 0 If $spiRet[0] = 0 Then Return 0 Local $aRet[4] = [DllStructGetData($dRECT, 1), DllStructGetData($dRECT, 2), DllStructGetData($dRECT, 3), DllStructGetData($dRECT, 4)] Return $aRet EndFunc Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Siao Posted September 22, 2007 Share Posted September 22, 2007 (edited) Yes, that's probably the way to go Note that it also takes into acount all docked toolbars that have "always on top" turned on. Also it will ignore taskbar if it has "auto hide" turned on. Edited September 22, 2007 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now