Invisible...

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Adequat
Posts: 97
Joined: 20 Jul 2007 12:03

Invisible...

Post 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.

admin
Site Admin
Posts: 67226
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Invisible...

Post 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.

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Invisible...

Post 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?

Adequat
Posts: 97
Joined: 20 Jul 2007 12:03

Post 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.

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Post 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.

admin
Site Admin
Posts: 67226
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post 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?

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Post 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!)

admin
Site Admin
Posts: 67226
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post 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.

JustinF
Posts: 358
Joined: 28 Jun 2005 23:47
Location: Omaha, Nebraska, USA

Post by JustinF »

I haven't researched it much, but it looks like user32.dll may have some methods to help you (MonitorFromPoint, etc.)??
Justin
Windows 7 Professional

admin
Site Admin
Posts: 67226
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post 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:

Pagat
Posts: 310
Joined: 09 Oct 2007 21:23
Location: Austria

Post 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...
OS: Windows 11, 64-bit, Version 25H2, Build 26200.8655 (10.0), AMD64
Monitor: 1/2 (Primary) Primary Screen DPI: 96 (100%)

admin
Site Admin
Posts: 67226
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post 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...

JustinF
Posts: 358
Joined: 28 Jun 2005 23:47
Location: Omaha, Nebraska, USA

Post 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:
Justin
Windows 7 Professional

admin
Site Admin
Posts: 67226
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Invisible...

Post 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.

admin
Site Admin
Posts: 67226
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Invisible...

Post 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??

Post Reply