Saved window position on second monitor.

Support for xplorer² free lite version

Moderators: fgagnon, nikos, Site Mods

User avatar
eikonos
New Member
Posts: 3
Joined: 2003 Sep 15, 23:33
Location: Canada

Saved window position on second monitor.

Post by eikonos »

If I save the window position with Actions->Save Settings Now while xplorer2 is on the second monitor, the next time xplorer2 loads it appears in the default position on the primary monitor.

It seems that the window position is validated when xplorer2 loads, but only validated against the primary monitor rectangle.

multimon.h and ClipOrCenterWindowToMonitor() offers a simple way to do this with single or multiple monitors:
http://msdn.microsoft.com/library/defau ... r_9t0w.asp[/url]

cheers,
Daniel
User avatar
nikos
Site Admin
Site Admin
Posts: 16296
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

it works fine on my multi-monitor system
sometimes the desktop management system in use is to blame for such abnormalities. "Good" systems just use the second monitor as an extension of desktop real estate (width-wise)

also note that "save settings now" will be overwritten if you also have "save settings on exit"
User avatar
eikonos
New Member
Posts: 3
Joined: 2003 Sep 15, 23:33
Location: Canada

Post by eikonos »

I am not using "Save Settings Now".

I don't understand what you mean by "desktop management system" because I'm using the default window managment code that's built into Windows XP.  I am not using Hydravision or nView.
I use a number of applications (foobar, xchat, thunderbird) that all load on my second monitor.  xplorer2 is the only one which will not.
"Good" systems just use the second monitor as an extension of desktop real estate (width-wise)


It sounds like you're using Win2K because that system considers all monitors to be part of one big desktop.  WinXP is completely different: each monitor is separate.  If you use SystemParametersInfo( SPI_GETWORKAREA, ... ) you will only get the rectangle of the primary monitor on XP.  As MSDN indicates http://msdn.microsoft.com/library/defau ... rsinfo.asp: "To get the work area of a monitor other than the primary display monitor, call the GetMonitorInfo function." An easy way to do that is to use the ClipOrCenterWindowToMonitor() function that I mentioned in my other post.

I did a quick test and saved xplorer2's settings with the window in various places.  It will load up where it was last as long as there is a narrow sliver of the window on the primary desktop, but as soon as the whole window is on the secondary monitor, it will load at the default position on the primary monitor.

I loaded HKEY_CURRENT_USER\Software\ZabaraKatranemia Plc\xplorer2\MainFrame Settings\binWindowPlacement into a WINDOWPLACEMENT struct and it is saving the correct coordinates of the secondary monitor, so it must be validating against the primary monitor rect when it loads.
User avatar
nikos
Site Admin
Site Admin
Posts: 16296
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

yes, i mostly use 2000 where it works fine
i don't have a XP dual-monitor system to test so i'll just file this as a pending bug
User avatar
eikonos
New Member
Posts: 3
Joined: 2003 Sep 15, 23:33
Location: Canada

Post by eikonos »

I'm happy to help with sample code or testing.
User avatar
nikos
Site Admin
Site Admin
Posts: 16296
Joined: 2002 Feb 07, 15:57
Location: UK

Post by nikos »

i will most probably take your offer on this!

however, i've been reading a little about these multiple monitors on MSDN and i quote:
The system tries to start an application on the monitor that contains its shortcut. So, one way to position an application is to have its shortcut on a desired monitor
how do you start x2? A desktop shortcut? Have you tried using a quicklaunch shortcut instead? That's what I use and don't have any problems