Page 1 of 2

Invisible...

Posted: 25 May 2008 08:25
by Adequat
Example:
If XY is maximized on screen #2.
If computer is rebooted with only one screen #1.
Then XY is invisible.
You should enforce, when displaying XY, that it appears on some visible area.

Re: Invisible...

Posted: 25 May 2008 21:03
by admin
Adequat wrote:Example:
If XY is maximized on screen #2.
If computer is rebooted with only one screen #1.
Then XY is invisible.
You should enforce, when displaying XY, that it appears on some visible area.
Thanks. I'll do something about it in the next beta version.

Re: Invisible...

Posted: 25 May 2008 22:13
by PeterH
Adequat wrote:If computer is rebooted with only one screen #1.
Just a question to verify: what did you do to change it? Just turn off or disconnect the 2nd screen, or deactivate it in display settings?

Posted: 26 May 2008 09:22
by Adequat
The monitor #2 is physically absent.
Note that if I right click on the XY tab in the Windows bar, and select "Maximize", then XY becomes visible and maximized on the screen. But there is no way to get out of the maximized/minimized mode, because the "Restore" sets the windows out of view.

Posted: 26 May 2008 14:47
by PeterH
Fine: there is always something to learn...
...lerned: there is a difference between a connected but powered-off monitor to a disconnected monitor! (Didn't expect this...)

So: opened TaskManager, Firefox and XY on 2nd monitor, then rebooted with disconnected 2nd Monitor.
- in display settings 2nd monitor was shown kind of inactive. ("Dotted")
- TaskMgr and Firefox opened on 1st monitor.
- XY if maximized on 1st, else (hidden) on 2nd monitor!
Next rebooted with 2nd monitor connected, but powered off:
- TaskMgr remained on 1st mon
- FF and XY were (hidden) on 2nd, again. (No matter if maximized or not.) So could only be seen after power-on.

Posted: 26 May 2008 14:55
by admin
Could you please open XYplorer.ini and look for

WinX=...
WinY=...

This is the position in pixels. What are the values when XY is hidden on the 2nd monitor? Is WinX larger than the width of the first monitor?

Posted: 26 May 2008 15:17
by PeterH
Maybe a strange result? WinX=-1133, WinY=80
I think negative WinX is, as my 2nd mon is located on the left side of the first one?
(As I did not set "Save Settings on Exit" this can not change automatic!)

Posted: 26 May 2008 15:34
by admin
PeterH wrote:Maybe a strange result? WinX=-1133, WinY=80
I think negative WinX is, as my 2nd mon is located on the left side of the first one?
(As I did not set "Save Settings on Exit" this can not change automatic!)
Aha, interesting. Your analysis sounds good to me.

My problem is: I can easily ensure that XY is always visible on monitor #1, but I cannot know (resp. I don't know how to find out) whether monitor #2 (or, worse, #1!) is turned/plugged off.

Posted: 26 May 2008 17:29
by JustinF
I haven't researched it much, but it looks like user32.dll may have some methods to help you (MonitorFromPoint, etc.)??

Posted: 26 May 2008 19:32
by admin
JustinF wrote:I haven't researched it much, but it looks like user32.dll may have some methods to help you (MonitorFromPoint, etc.)??
Yes, I heard of them as well. I just avoided messing around with them because having only one monitor it's a bit difficult to debug... :wink:

Posted: 26 May 2008 20:29
by Pagat
In Delphi there is a "built-in" function named GetDesktopRect which delivers the coordinates of the visible desktop area of all monitors. I just dug around in the source code to check how the values are catched from the system. The WinAPI function GetSystemMetrics with below mentioned parameters should get you the visible area of all monitors.

Even if the following code is Delphi i hope it will help you to get what you need:

Code: Select all

function TScreen.GetDesktopTop: Integer;
begin
  Result := GetSystemMetrics(SM_YVIRTUALSCREEN);
end;

function TScreen.GetDesktopLeft: Integer;
begin
  Result := GetSystemMetrics(SM_XVIRTUALSCREEN);
end;

function TScreen.GetDesktopHeight: Integer;
begin
  Result := GetSystemMetrics(SM_CYVIRTUALSCREEN);
end;

function TScreen.GetDesktopWidth: Integer;
begin
  Result := GetSystemMetrics(SM_CXVIRTUALSCREEN);
end;
Some more info about GetSystemMetrics:

http://msdn.microsoft.com/en-us/library ... S.85).aspx


Edit:
PS: After reading the thread again: Though, i don't know if GetSystemMetrics delivers "correct" values if a monitor is plugged off...

Posted: 26 May 2008 20:42
by admin
Pagat wrote:In Delphi there is a "built-in" function named GetDesktopRect which delivers the coordinates of the visible desktop area of all monitors. I just dug around in the source code to check how the values are catched from the system. The WinAPI function GetSystemMetrics with below mentioned parameters should get you the visible area of all monitors.

Even if the following code is Delphi i hope it will help you to get what you need:

Code: Select all

function TScreen.GetDesktopTop: Integer;
begin
  Result := GetSystemMetrics(SM_YVIRTUALSCREEN);
end;

function TScreen.GetDesktopLeft: Integer;
begin
  Result := GetSystemMetrics(SM_XVIRTUALSCREEN);
end;

function TScreen.GetDesktopHeight: Integer;
begin
  Result := GetSystemMetrics(SM_CYVIRTUALSCREEN);
end;

function TScreen.GetDesktopWidth: Integer;
begin
  Result := GetSystemMetrics(SM_CXVIRTUALSCREEN);
end;
Some more info about GetSystemMetrics:

http://msdn.microsoft.com/en-us/library ... S.85).aspx


Edit:
PS: After reading the thread again: Though, i don't know if GetSystemMetrics delivers "correct" values if a monitor is plugged off...
Thanks! I will add a temporary scripting command to display those values...

Posted: 26 May 2008 22:19
by JustinF
admin wrote:
JustinF wrote:I haven't researched it much, but it looks like user32.dll may have some methods to help you (MonitorFromPoint, etc.)??
Yes, I heard of them as well. I just avoided messing around with them because having only one monitor it's a bit difficult to debug... :wink:
*gasp* You don't have two monitors yet? I couldn't function as a programmer without two monitors. :lol:

Re: Invisible...

Posted: 27 May 2008 14:36
by admin
Adequat wrote:Example:
If XY is maximized on screen #2.
If computer is rebooted with only one screen #1.
Then XY is invisible.
You should enforce, when displaying XY, that it appears on some visible area.
Please run new scripting command ::virtualscreen and find out whether unplugged monitors are taken into account by the returned virtual desktop dimensions or not.

Re: Invisible...

Posted: 28 May 2008 21:56
by admin
admin wrote:
Adequat wrote:Example:
If XY is maximized on screen #2.
If computer is rebooted with only one screen #1.
Then XY is invisible.
You should enforce, when displaying XY, that it appears on some visible area.
Please run new scripting command ::virtualscreen and find out whether unplugged monitors are taken into account by the returned virtual desktop dimensions or not.
Hello? Lost interest??