NiceBoy1234 Posted January 14, 2016 Posted January 14, 2016 I want to get the window coordinates of the command line window I tried following but it cannot acces the variable $aPos... Local $sCommandlinePath = "C:\Windows\system32\cmd.exe" RunCm() Func RunCm() RunWait($sCommandlinePath) ; Retrieve the position as well as height and width of the active window. Local $aPos = WinGetPos("[CLASS:ConsoleWindowClass]") ; Display the array values returned by WinGetPos. MsgBox($MB_SYSTEMMODAL, "", "X-Pos: " & $aPos[0] & @CRLF & _ "Y-Pos: " & $aPos[1] & @CRLF & _ "Width: " & $aPos[2] & @CRLF & _ "Height: " & $aPos[3]) EndFunc While 1 Sleep(1000) RunCm() WEnd
Moderators JLogan3o13 Posted January 14, 2016 Moderators Posted January 14, 2016 (edited) You call the console window with RunWait, which means the script is going to wait until that window disappears. If you change it to Run and add a sleep to give the window time to appear, it should work just fine. Edited January 14, 2016 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
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