Author Topic: feature request: multi monitor window position remember  (Read 4362 times)

Offline Snu

  • Workaholic artist
  • ***
  • Posts: 320
  • Gender: Male
    • http://www.snuq.com
  • Operating System: Windows 7 64bit
feature request: multi monitor window position remember
« on: January 22, 2006, 01:16:17 »
ok, i really dont know why, nor do i know how difficult it is to implement, but for some reason with a multi monitor setup, some programs remember which monitor they were on, and some dont.  mpt doesnt, which means every time i open it i have to move it to my other monitor (since it opens on the default one).  
yah, not a very big deal i know, but just wondering if its something simple to implement? and well, cant hurt to ask...

Offline rewbs

  • OpenMPT Developers
  • *****
  • Posts: 578
Re: feature request: multi monitor window position remember
« Reply #1 on: January 22, 2006, 09:36:46 »
Quote from: "Snu"
just wondering if its something simple to implement?

I have absolutely no idea. :D
It's a bit strange, since MPT does remember its window size and position on my system, and I always thought which monitor a window appeared on was just dependent on the window position (since you can drag from one monitor to the other - at least on the few multi-monitor systems I have used). Any education would be appreciated.

Offline Waxhead

  • Workaholic artist
  • ***
  • Posts: 251
  • Gender: Male
    • http://www.dirtcellar.net
  • Operating System: WinXP , Linux
feature request: multi monitor window position remember
« Reply #2 on: January 22, 2006, 11:38:15 »
In my programs I use this... and it works perfectly. I assume ModPlug uses the same functions.
Code: [Select]

      WINDOWPLACEMENT wpl;
      wpl.length = sizeof(WINDOWPLACEMENT);

      GetWindowPlacement(hwnd,&wpl);
      SetWindowPlacement(hwnd,&wpl);

However testing this multimonitor functionallity I found a workaround for ModPlug running on another monitor.

Move ModPlug (as a normal window) to the monitor you want it to run at. Close the window (don't maximize it). Then reload modplug (it should now open on the monitor you want), maximize it and the close it! Now modplug will load maximized on the monitor you want :)
Also be carefull to not use SetWindowPos() on the coordinates returned by GetWindowPlacement() use SetwindowPlacement() instead!

I assume that his is because ModPlug don't move the window before calling ShowWindow(); so that it will be maximized at the default display.

Also please note that many programmers seem to forget that sometimes wierd people (like me) would like to have their second monitor to the left instead of right (= negative offsets) There's many programs who will work correctly if the 2nd monitor is to the right but fail if it's on the left side.

edit: fixed some typo's

Offline Snu

  • Workaholic artist
  • ***
  • Posts: 320
  • Gender: Male
    • http://www.snuq.com
  • Operating System: Windows 7 64bit
feature request: multi monitor window position remember
« Reply #3 on: January 22, 2006, 23:08:57 »
haha, how strange...
well, its on my second monitor now, thanks for the help waxhead!
i also have my second monitor on the left by the way, havnt had any troubles other than some programs not remembering which monitor they were on.  well, sometimes monitor one gets completely garbled if the rez/color depth is changed... have yet to find the cause for that (might be the nvidia drivers).