Jump to content
Sign in to follow this  

Making a window active

Recommended Posts


So I run a res of 1920x1200. I have a program that is 640x480. I need to make sure its active as the MouseClick positions are in 640x480 cords, not 1920x1200. Basically its in windows mode not fullscreen. I use Autohotkey to find the mouse positions for me, I'm not sure if there is a better program. But anyhow the problem I have is that even though I check to see if its active, and pops the program up if its not. It still sends my mouse to 300 300 in 1920 not In the active window. I really have no idea how to fix this problem. But I would prefer to be able to write one script which works for all screen resolutions rather than 10 different ones for each screen res. Code below.

WinWait ( "Program" )
WinActivate ( "Program" )
WinWaitActive ( "Program" )

Sleep( 200 )

Func Login (); Logs in
    MouseClick ( "Left", 395, 354 ,1 )
    Sleep( 100 )
    Send( "Login" )
    Send( "{ENTER}" )
    Sleep( 300 )
    MouseClick ( "Left", 265, 369 , 1 )
    Sleep( 600 )

Call( "Login" )

Share this post

Link to post
Share on other sites

Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client

see help



Share this post

Link to post
Share on other sites

Just starting out again with this.. There is so much to remember and try and learn. Trust I've looked over help already on a bunch of things. I also must say that the help with autoit so far is very well.. helpfull.


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