Dini

To set Focus on Windows window

4 posts in this topic

Hi,

I am unable to set the focus on the window, so that i can navigate to next text by sending [sendkeys ("string")]. 

Below is the code, I am using to launch and set focus :

ShellExecute("Perfmon.exe")
WinWaitActive("Performance Monitor")

;Clcking on the window using x and y co-ordinates to set the focus

MouseClick("primary", 120, 384)
Send("da")

Problem : I am unable to set the Focus on the launched Perfmon window

Please help me out on this.

Share this post


Link to post
Share on other sites



WinWaitActive returns the handle of the window, so use it to activate the window

$hWnd = WinWaitActive("Performance Monitor") 
;....
WinActivate($hWnd)

but Send is not very nice, you might use the AutoIt Info Tool to check the controls so you can directly act on them

Share this post


Link to post
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