Jump to content

Recommended Posts

Keep in mind that I'm a total noob at this stuff :whistle:

I want to focus on a window, click a button, and then right away focus back on the last window.

Now, I know the firs two bits:



Now all I want to figure out is the title of the window that is currently focused (before all of this).

Ie. Firefox is open, and Calculator is open.

Firefox has focus.

Focus on Calculator, calculate 5x5,

Focus back on Firefox

The Middle part I know how to do, and the last. The first part - figuring out what is the currently focused window, is my question.

Now, remember - you were a noob yourself once :)

Link to post
Share on other sites

Now, I know the firs two bits:



ControlClick does not need an active window as it directly works with the Control.

This example ControlClicks Calculator, but Calculator is not active.

Sleep(1000); just to see active notepad
ControlClick('Calc', '', '5')
ControlClick('Calc', '', '*')
ControlClick('Calc', '', '5')
ControlClick('Calc', '', '=')
Send('Some text')

Mouse* actions and Send require active windows so use WinActivate and WinWaitActive before using them.


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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...