Sign in to follow this  
Followers 0
Memnoch

WinGetPos problem

3 posts in this topic

#1 ·  Posted (edited)

Any idea why this works:

$win = WinGetPos ( "[Active]" )

and this doesn't:

$win = WinGetPos ( "Untitled - Notepad" )

Even tried portions of the name, as in "Un" and it still won't find the window. The first one works, you just have to make sure that the window you want to read from is made active first. I've looked through the description of the command and haven't spotted anything that might indicate I am doing something wrong but then that's me all over. :)

Edited by Memnoch

Share this post


Link to post
Share on other sites



Any idea why this works:

$win = WinGetPos ( "[Active]" )

and this doesn't:

$win = WinGetPos ( "Untitled - Notepad" )

Even tried portions of the name, as in "Un" and it still won't find the window. The first one works, you just have to make sure that the window you want to read from is made active first. I've looked through the description of the command and haven't spotted anything that might indicate I am doing something wrong but then that's me all over. :)

Works this?

Opt("WinTitleMatchMode", 2)

$win = WinGetPos ( "Notepad" )

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Sorry! It was me. The script was running through so fast that Notepad, at that point, was not even open. Putting in a simple WinWaitActive, or indeed a WinExists loop, fixed it. Thanks for your reply anyway. I knew I was missing something as I've never had problems with that before. :)

Edited by Memnoch

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
Sign in to follow this  
Followers 0