Sign in to follow this  
Followers 0
5471665561

Automatically moving windows

5 posts in this topic

I've been having an issue with windows popping up behind my game (I play it in windowed+maximized due to running dual screens and sometimes my game just refuses to let other windows take the foreground from it). So my solution was to design an autoit script that would take all newly opened windows that are smaller than a certain size and move them to the center of my secondary screen for easy usage. I think the idea would work in theory but I'm not specifically sure how to implement it. I know i can get the windows size via WinGetPos(if i have the windows title) and i know i can move the window to a certain position via WinMove(which once again requires a title). My issue is that I don't know what command to use to get the title of any program on my main screen. Any ideas?

Share this post


Link to post
Share on other sites



I know nothing about dual monitors, but a start for your problem might be to look at the WinList() function which returns an array of all the windows. If you run that in a loose loop every so ofter and check fro extra windows, it lists window name and handle in most cases.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

well for my particular setup, my "main" screen is right and my "secondary" screen is left, so position wise i just send the window to -500 for example...as for the command...i appreciate it

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Is it possible to use Or in an If statement in autoit? Such as if windowSize[2] < certainAmount or windowSize[3] < certainAmount

If so how?

EDIT: nvm, found it

Edited by Durnt

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