pixelsearch Posted March 4, 2021 Share Posted March 4, 2021 (edited) Just add 3 lines and modify a 4th one : ... Global $nIniXPos = Int(IniRead($sMyIniLocation, 'MAINWINPOS', 'XPOS', Int(@DesktopWidth/2.95))) Global $nIniYPos = Int(IniRead($sMyIniLocation, 'MAINWINPOS', 'YPOS', Int(@DesktopHeight/3.95))) Global $iWidth = 590, $iHeight = 515 ; <=== ADD $nIniXPos = (($nIniXPos <> -32000) ? ($nIniXPos) : ((@DesktopWidth - $iWidth) / 2)) ; <=== ADD $nIniYPos = (($nIniYPos <> -32000) ? ($nIniYPos) : ((@DesktopHeight - $iHeight) / 2)) ; <=== ADD ... ; GUICreate("Download Video", 590, 515, $nIniXPos, $nIniYPos, Default, $WS_EX_TOPMOST) GUICreate("Download Video", $iWidth, $iHeight, $nIniXPos, $nIniYPos, Default, $WS_EX_TOPMOST) ; <=== MOD If it saves it at -32000, -32000, then it will be restored in the middle of the screen, isn't it enough ? In fact the question is : do you have a problem if coords are saved at -32000, -32000 and the GUI reopens in the middle of the screen ? If it is a problem, then my 4 lines patch won't help Edited March 4, 2021 by pixelsearch Link to comment Share on other sites More sharing options...
TalesFromTheScript Posted March 4, 2021 Author Share Posted March 4, 2021 Cheers pixelsearch it works perfectly. Link to comment Share on other sites More sharing options...
pixelsearch Posted March 4, 2021 Share Posted March 4, 2021 Really ? Lucky me, I came back to modify the code lol 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