zuladabef Posted January 25, 2019 Share Posted January 25, 2019 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? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 25, 2019 Moderators Share Posted January 25, 2019 (edited) 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 January 25, 2019 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 More sharing options...
zuladabef Posted January 25, 2019 Author Share Posted January 25, 2019 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 More sharing options...
FrancescoDiMuro Posted January 25, 2019 Share Posted January 25, 2019 (edited) @zuladabef Maybe WinMove() doesn't find the window? Check it using WinExists() Edited January 25, 2019 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
xcaliber13 Posted January 25, 2019 Share Posted January 25, 2019 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 More sharing options...
jdelaney Posted January 25, 2019 Share Posted January 25, 2019 Winlist...loop through the returned array of handles. winmove each IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
MattHiggs Posted January 25, 2019 Share Posted January 25, 2019 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 More sharing options...
zuladabef Posted January 28, 2019 Author Share Posted January 28, 2019 @xcaliber13 I used a variation of your method and it worked! Link to comment Share on other sites More sharing options...
zuladabef Posted January 28, 2019 Author Share Posted January 28, 2019 @xcaliber13 I used a variation of your method and it worked! Link to comment Share on other sites More sharing options...
ad777 Posted December 5, 2021 Share Posted December 5, 2021 (edited) 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 December 5, 2021 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now