PartyPooper Posted April 30, 2007 Share Posted April 30, 2007 I had a quick search in the forums and checked out the Windows Management section of the Help file but I haven't found anything that will allow me to force a GUI to open on the Primary (or Secondary) monitor for those systems that run two or more monitors. Can anyone point me in the right direction or isn't AutoIt able to do this (yet)? Link to comment Share on other sites More sharing options...
PartyPooper Posted May 1, 2007 Author Share Posted May 1, 2007 Bump Anyone have any ideas yet? Link to comment Share on other sites More sharing options...
PartyPooper Posted May 6, 2007 Author Share Posted May 6, 2007 From the lack of responses, I'll assume AutoIt can't do it yet. Can any Devs give me an indication as to whether or not something like this will be included in a future release? Link to comment Share on other sites More sharing options...
pdaughe Posted May 6, 2007 Share Posted May 6, 2007 (edited) PartyPooper, I'm not quite sure what you're looking for in the way of AutoIt support. There are WMI scripts on the forum that enable you to get the coordinates of all the monitors on your system. Your application could then open any of it's windows on any of the monitors simply by using the correct coordinates. I run multiple monitors and I have Windows set to extend the desktop to the second monitor. The first monitor's x position is 0, the second monitor's x position is 1281 (the first monitor's resolutin is 720 by 1280) and the second monitor is position to the left of the first (you tell Windows). It's been a while since I've looked at this to recall what the configuration looks like if the desktop is not extended. Of course, a simplistic way around it is to simply use the Nvidia graphics driver which allows you to define profiles for application, including what monitor an application's windows should open on (everyone one uses Nvidia, right?) or a package like UltraMon. If I create a window using GUICREATE (400, 400, 1281, 0) it opens in the upper-left corner of the second monitor. Do these comments help at all? Sincerely, Paul Edited May 6, 2007 by pdaughe Link to comment Share on other sites More sharing options...
Kickassjoe Posted May 6, 2007 Share Posted May 6, 2007 2 monitors connected to the same machine? I think all you have to do is put it further on the x or y axis, depending on how the monitors are placed. for example: GUICreate(@desktopwidth + 50, 50, 500, 500) would make it appear on the second monitor if the 2 monitors were placed next to each other. P.S. that would only work if @desktopwidth returns the width of one of the monitors, and not both (im not sure), so you could use @desktopwidth/2 if it returns the width of both. What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
PartyPooper Posted May 6, 2007 Author Share Posted May 6, 2007 I run multiple (two) desktops with desktop spanning turned off (using the nVidia software). I tried the profiles and they work for AutoIt written apps, but not all apps, so I wanted to write an AutoIt one to force those apps that didn't work to open on a particular monitor. I might try desktop spanning to see if I get better results, In any case, you've given me an idea and a start - thanks. Link to comment Share on other sites More sharing options...
PartyPooper Posted May 6, 2007 Author Share Posted May 6, 2007 2 monitors connected to the same machine? I think all you have to do is put it further on the x or y axis, depending on how the monitors are placed. for example: GUICreate(@desktopwidth + 50, 50, 500, 500) would make it appear on the second monitor if the 2 monitors were placed next to each other. P.S. that would only work if @desktopwidth returns the width of one of the monitors, and not both (im not sure), so you could use @desktopwidth/2 if it returns the width of both. Yeah, how to use the @Desktop... macros is what is confusing me. Because I run different resolutions on both monitors, I'm not sure how to get the variables using @Desktop... I guess I may be able to use WMI, however, I was hoping that they (the Devs) would include addition functionality to these macros to make my life easier Link to comment Share on other sites More sharing options...
Kickassjoe Posted May 6, 2007 Share Posted May 6, 2007 Because I run different resolutions on both monitorsWhere does that get you? I don't have more than one monitor, so I have no idea what that would do for you.You could use WinSetPos() to put a GUI window on a different monitor... I wouldn't know how to go about making it open on that monitor though... What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
PartyPooper Posted May 7, 2007 Author Share Posted May 7, 2007 I have monitor 1 set up for 1280 x 1024 and monitor 2 set up for 1024 x 768. It's weird but the AU3Info tool reports: Overall Size x: -1280 y: 0 w: 2304 h: 768 With each monitor coordinates as follows: Monitor 1 Upper Left: x: -1280 y: 0 Lower Right: x: -1 y: 1023 Monitor 2 Upper Left: x: 0 y: 0 Lower Right: x: 1023 y: 767 From this it isn't too hard to place items but if I was to change resolutions, I run into the problem of not being able to automatically detect the new resolutions on both monitors from within a program (I would have to manually put them in as variables). Link to comment Share on other sites More sharing options...
PartyPooper Posted May 7, 2007 Author Share Posted May 7, 2007 You could use WinSetPos()This function is not listed in v3.2.0.1 or v3.2.3.13 (beta) Help files - did you mean WinMove()? Link to comment Share on other sites More sharing options...
Kickassjoe Posted May 7, 2007 Share Posted May 7, 2007 (edited) Yeah, that one. It's been so long since I have used window functions, sorry. EDIT: just read your 2nd to last post... WinMove($title, $text, $x / $CurrentxResolution * $NewxResolution, $y / $CurrentyResolution * $NewyResolution)? Edited May 7, 2007 by Kickassjoe What goes around comes around... Payback's a bitch. 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