etidd Posted September 20, 2023 Share Posted September 20, 2023 So, I had a new idea to create a UDF that checks the current screen resolution and window sizes to ensure that the script will properly execute as tested. Maybe I would put it in a separate .au3 file and include it with most scripts. This is similar to what I am doing by checking if certain processes are running and closing them before executing a script as if a program is currently running, it may cause a problem in execution. Perhaps this has already been done before as it seems like it may be a sound practice. If a window size is different than when it was tested, it may cause the script to malfunction. Does anyone do things like this or calculate coordinates by function? Or is this overblown and just better to target everything with precise coordinates? Link to comment Share on other sites More sharing options...
rudi Posted September 26, 2023 Share Posted September 26, 2023 Hi. Taken from some other posting in this forum, just a snippet to give you a start: Func DesktopWorkingAreaHeight() 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)] Local $MaxHeight = $aRet[3] - $aRet[1] ; substract height of task bar $TitleBarHeight = _WinAPI_GetSystemMetrics($SM_CYCAPTION) Return $MaxHeight - $TitleBarHeight - 10 EndFunc ;==>DesktopWorkingAreaHeight etidd 1 Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Solution ioa747 Posted September 26, 2023 Solution Share Posted September 26, 2023 (edited) if the @DesktopWidth, @DesktopHeight is not enough for you take a look here Moves and/or resizes and arrange windows between multi monitors. Func _MM_GetMonitorsArray() hope it helps Edited September 27, 2023 by ioa747 UpDate etidd 1 I know that I know nothing 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