Jump to content

WinMove and Multiple Windows


Recommended Posts

  • Moderators

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!

Link to comment
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)

 

Link to comment
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

Link to comment
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:

 

 

Link to comment
Share on other sites

  • 2 years later...
On 1/25/2019 at 6:28 PM, zuladabef said:

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?

#include <WinAPISysWin.au3>
#include <Array.au3>
#include <WinAPISys.au3>
#RequireAdmin
#comments-start

Made by Ad777
#comments-end
_MoveMultiWindow("Untitled - Notepad","",0,0,100,100,1,1,2,100)


#comments-start
Function Name : _MoveMultiWindow
Parameters:
////////title:name of the window
////////text:The text of the window to check. Default is an empty string
////////$x:new x position of window
////////$y:new y position of window
////////$width:new width of window
////////$height:new height of window
////////$speed:the speed to move the windows in the range 1 (fastest) to 100 (slowest). If not defined the move is instantaneous
///////start:start number to be searched Default = 1
//////end:end number of searching ex:3 OR 10
//////Sleep:sleep for while ex:100
#comments-end
#comments-end
Func _MoveMultiWindow($title,$text,$x,$y,$width,$height,$speed,$start,$end,$sleep)
Local $aArray = WinList($title)
   For $i = $start To $end Step 1
      WinMove($aArray[$i][1],$text,$x,$y,$width,$height,$speed);;;
      Sleep($sleep)
Next
   EndFunc

i hope this help ya☺️

Edited by ad777

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

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