punchcard Posted August 28, 2013 Share Posted August 28, 2013 (edited) I have been trying to consistancely select the actual input part of the Vsphere client console window (vmware). Some times it works flawlessly, and activaties the window, then insert the OS build string. The some time is will that the string I am trying to pass to the console and randomly select button (like power down, cd, floppie.....) I have tried to using the "Class" of MKSEmbedded (see image), but have had no luck selecting by class. I figure I am not correctly address the area of the window I want to pass the information to. Anyone have suggestion? ================ code example ============= Opt("WinTitleMatchMode", -4) Global $sWinTitle = $cServer, $hWin $hWin = WinGetHandle($sWinTitle, "") WinActivate ($hWin) WinWaitActive($hWin) Send("{CTRLDOWN}g{CTRLUP}") MouseClick("left",0) Sleep(1000) Send( $sndstring) Send("{ENTER}") Sleep (3000) Send("{CTRLDOWN}{ALTDOWN}{ALTUP}{CTRLUP}") ==================================================== Edited August 28, 2013 by punchcard Regards, Mike D Link to comment Share on other sites More sharing options...
Solution punchcard Posted August 30, 2013 Author Solution Share Posted August 30, 2013 Here is the code I ended up using, it seems to select the console window correctly now each time. This is for RHEL build process, so it is handy in a Satellite or Spacewalk build. ; ; Here is the GUTS of selecting the correct window in VMware Console ; "WindowsForms10.Window.8.app.0.ef627a" ; CLASS:MKSEmbedded; INSTANCE:1" Opt("WinTitleMatchMode", -4) opt("MouseCoordMode",2) $retWin = WinGetHandle($cServer) $ctrlHandle = ControlGetHandle($retWin, "", "[Class:MKSEmbedded]") $xy = ControlGetPos($retWin, "", $ctrlHandle) $xpos = $xy[0] + ($xy[2] / 2 ) $ypos = $xy[1] + ($xy[3] / 2 ) WinActivate($retWin) MouseClick("primary", $xpos, $xpos, 1, 0) Send("{CTRLDOWN}g{CTRLUP}") MouseClick("left",0) Sleep(1000) Send( $sndstring) Send("{ENTER}") Sleep (3000) Send("{CTRLDOWN}{ALTDOWN}{ALTUP}{CTRLUP}") Regards, Mike D 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