Jump to content
Macro Express Forums

Swap active screen to other monitor


asrjcb

Recommended Posts

Hi,

 

I'm a newbie, but all I want to do is to be able to take the active window and move it to the next monitor. So if the window is on monitor 1, and I have 3 monitors, move it to monitor 2, and then with another press of the hotkey, to monitor 3. After it gets to monitor 3, then it would move it back to monitor 1. I can't seem to fiture it out with just the window reposition commands. Can someone help?

Link to comment
Share on other sites

Here's something to get you started. Please note I wrote this in MEP, so it's possible, but not likely, that I've used commands that are not available in ME3. In any case, you will have to change the variable names to the ME3 standards! All variables are integer.

You need to adjust for the following situations:

- My 3 monitors (1280 x 1024) are arranged: #3 on the left, #1 (primary) in the middle, #2 on the right. This means that my screen coordinates are:

  #1) -1280, 0  to   -1, 1023
  #2)     0, 0  to 1279, 1023
  #3)  1280, 0  to 2559, 1023

- Yours are probably different, so you need to change lines 5 - 13

- I haven't bothered with determining whether the current window is maximized or not, so its final state is restored

- I assume all monitors have the same width

Variable Set Integer %nScreens% to 3 ' set this to the number of monitors; if other than 3,
                                    ' you'll have to add or subtract the conditional logic in lines 5 - 13.
Variable Set Integer %nWidth%: Set to the Screen Width
Variable Set Integer %nLeft%: Set to the Current Window's Left
Variable Set Integer %nTop%: Set to the Current Window's Top
If Variable %nLeft% Is Less Than "0"
 Variable Modify Integer: %nLeft% = %nLeft% + %nWidth%
Else
 If Variable %nLeft% Is Less Than "%nWidth%"
   Variable Modify Integer: %nLeft% = %nLeft% + %nWidth%
 Else
   Variable Modify Integer: %nLeft% = %nLeft% - %nWidth%
   Variable Modify Integer: %nLeft% = %nLeft% - %nWidth%
 End If
End If
Window Restore: <Current Window>
Window Reposition: <Current Window> Position: %nLeft%, %nTop%

Link to comment
Share on other sites

Hi,

 

I'm a newbie, but all I want to do is to be able to take the active window and move it to the next monitor. So if the window is on monitor 1, and I have 3 monitors, move it to monitor 2, and then with another press of the hotkey, to monitor 3. After it gets to monitor 3, then it would move it back to monitor 1. I can't seem to fiture it out with just the window reposition commands. Can someone help?

 

If you are using windows 7, you can hold down the win key and use arrows to move the active window around.

 

e.g. Win + right arrow move screen one monitor to the right

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...