Jump to content
Sign in to follow this  
zuladabef

WinMove and Multiple Windows

Recommended Posts

How does WinMove with Multiple Windows work?  If the window in on Display 2, and I WinMove("","", 0, 0) does it move to Display 1, or Display 2?  In other words, how do I move a window between displays?

Share this post


Link to post
Share on other sites

For the first part of your question, you could probably test what it does faster than you could type out the question. Try exactly what you said, WinMove)"", "", 0, 0) on a mult-monitor system - what does it do?

For the second part of your question, have you searched the forum? A search of "winmove multiple monitor" returns a number of instances where this has been discussed. What have you tried?

Edit: A google search returns even more results - site:autoitscript.com winmove multiple monitor

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

I tried the following, but it wasn't moving to Display 1, so I was trying to determine if the displays are seen as one giant display, or two.  I did find some custom functions, but I assumed that must have been an oversight.  It seemed like AutoIt would have this native.  So the only way to do this is through something like this UDF?

WinMove ( "Chrome", "", 0, 0)
WinSetState("Chrome", "", @SW_MAXIMIZE)

 

Share this post


Link to post
Share on other sites

@zuladabef
Maybe WinMove() doesn't find the window?
Check it using WinExists() :)

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

When I close IE on my second monitor, that is where it will start backup.  I run a script that needs to run on my main monitor.  This is what works for me.  Should be able to adapt it to work with Chrome. 

$oIE = _IECreate ("https://www.yourwebsite.com")
Sleep (3000)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinMove($HWND, "", 0, 0, 400, 400)
Sleep (6000)
WinSetState($HWND, "", @SW_MAXIMIZE)

This will always (at least for me) end up with a maximize IE window on my main monitor

Share this post


Link to post
Share on other sites
4 hours ago, xcaliber13 said:

When I close IE on my second monitor, that is where it will start backup.  I run a script that needs to run on my main monitor.  This is what works for me.  Should be able to adapt it to work with Chrome. 

$oIE = _IECreate ("https://www.yourwebsite.com")
Sleep (3000)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinMove($HWND, "", 0, 0, 400, 400)
Sleep (6000)
WinSetState($HWND, "", @SW_MAXIMIZE)

This will always (at least for me) end up with a maximize IE window on my main monitor

There is actually an autoit script you can download in the downloads section which already does something very similar to what you want:

 

 

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...