Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WINDOW FOCUS

Status
Not open for further replies.

IncredibleVolk

Technical User
Apr 2, 2004
67
US
I'm attempting to login to another computer remotely. Everything is working up to the Windows Login which is titled "Log On To Windows". The Windows Login Window is inside of the Remote Connection window and I can't make it the focus.


#Include "VKEYS.INC"

proc main

string sRemote
integer WinId ; Handle to window.
integer TaskId ; task id.

set aspect keys on

rxflush
pause 1
txflush
pause 1
keyflush
pause 1

winminimize $PWMAINWIN
pause 1
strfmt sRemote "C:\Windows\system32\mstsc.exe"
run sRemote TaskId
taskwin TaskId WinId ; Get window id for task.
winfocus WinId ; Set focus to window.
termmsg "%d" WinId
pause 1
sendkeystr "<IP ADDRESS>" ;Remote Login
pause 1
sendkey ALT 'N' ;Remote Connect
taskexit TaskId
pause 2
winactivate "<IP ADDRESS> - Remote Desktop"
pause 1
winfocus "<IP ADDRESS> - Remote Desktop"
pause 3
winmaximize $ACTIVEWIN ;maximize remote window
pause 1
***I CAN'T GET IT TO PLACE FOCUS***
winactivate "Log On To Windows"
winfocus "Log On to Windows"
enable WINDOW $FOCUSWIN
pause 1
sendkeystr "<PASSWORD>"
pause 3
sendvkey 13 ;ENTER KEY
endproc



 
Is the winactivate "Log On To Windows" dialog displayed by the remote computer (my test machine is not working to connect to at the moment, but I suspect so)? If so, then I would not expect Procomm to be able to set access to it as it is not a "true" window that can be accessed but most likely a bitmap or some similar image displayed by RDP.

 
If you just send the password or paste it, does it get sent? I'm wondering if you may be able to play with the tab key (0x09 I think) to get focus where you need and then send the string? I'll play with this more at work if I can make my test machine happy.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top