Jump to content

Can I select a window by clicking on it?


flat5
 Share

Recommended Posts

to get the currently active window's title...

$szTitle = WinGetTitle("")

Lar.

<{POST_SNAPBACK}>

I know about that, but I don't see how it solves the problem. How would I pause and then resume the script such that the WinGetTitle("") would grab the just activated window?

Thanks.

Link to comment
Share on other sites

Maybe you should check every second or so what is the active window and if it is one where you want to automate something start the relative code.

E.g.

While 1
   $SZTITLE = WinGetTitle("")
   Select
      Case $SZTITLE = "My first program"
        ;Do what I want on My first program
      Case $SZTITLE = "My second program"
        ;Do what I want on My second program
      Case Else
         Sleep(1000)
   EndSelect
Wend

@Larry... What is the meaning of this strange SZ ? it werent easier just say $Title? :ph34r:

Edited by ezzetabi
Link to comment
Share on other sites

I admit, I don't have a handle on what you want to do. If you describe it with more detail I may be able to help. I am grasping at straws with my responses.

LAr.

<{POST_SNAPBACK}>

I want to start a script, and have it prompt me for the window I want to automate. I respond by clicking in the window, and it carries on and works with that window.
Link to comment
Share on other sites

sz is a common programmers prefix which means the variable contains a string.

<{POST_SNAPBACK}>

:(

But... AFAIK all vars in Autoit are Variant and so can keep every kind of data... What is the meaning?

(Sorry for the out-topic, but I am interested) :ph34r:

Link to comment
Share on other sites

It means exactly what I said. Its a hint to the programmer that the variable with that prefix with be a string. It has nothing to do with the actual implementation of the datatype or that the datatype in theory can hold numbers or whatever. Its along the same lines of why you might name a function after what it does (FileDelete()) instead of some arbitrary name (MonkeyBrains()). Its a descriptive measure to help at-a-glance reading of code.

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...