Jump to content

Sending keystrokes to a window


brodie28
 Share

Recommended Posts

Well, in that case, what do you use as a control ID? I did a test with notepad and using the notepad window handel as the control ID but it didn't work ...

I believe the logic is that Notepad does have controls, notably "Edit1". If you set no ControlID, such as "", then there is nowhere on Notepad to ControlSend the string. A cmd prompt in comparison has no ControlID's to use other then the window itself, so ControlSend will send the string to the window (control).

; Title may vary dependant on system
$title = 'C:\WINDOWS'

Run('CMD')
WinWait($title)
ControlSend($title, '', '', 'string of text')
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...