Sign in to follow this  
Followers 0
Mechaflash

Moving windows to another monitor

4 posts in this topic

How would I target a 2nd monitor (in extended mode) for a `Run()` or a `WinMove()` function?


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites



Hi, mechaflash213. I would start with _WinAPI_EnumDisplayDevices in the help file if you haven't already. It creates an array of installed monitors. This may get you started.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I've followed what you said, and I now have identified each monitor. I've even set up the conditional statements for the command, but now, I still need to tell it to move the window to the monitor in question. I don't see a way of targeting it in the `Run()` or `WinMove()` functions, but I'm thinking of iterating over the desktop resolution, and using the `WinMove()` function with negative parameters of the window.

Is this the method that I'm going to have to use or is there a better or more proper way?

EDIT: Just thought about something... if the user's monitor resolutions aren't identical, it won't work as intended as fetching the window resolution via @DesktopWidth and @DesktopHeight only returns the values for the primary display.

Edited by mechaflash213

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites

Have a look at this.

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