Profile properties Window out of desktop

English support for the software AllSync
Post Reply
Gaston
Posts: 10
Joined: 03 Dec 2004, 01:53

Profile properties Window out of desktop

Post by Gaston »

After the change of configuration of my multihead desktop the properties window does open outside of th evisible desktop. Not knowing how to access it there I have written a small tool to retrieve it to the visible area. This does work fine, but unfortunately the new position does not seem to be stored, thus the next time I open th eproperties of a profile it is outside the visible desktop again.

Trying to move the window or maximize it after it has been prgramatically retireved does not change this.

Best regards,
Gaston
Administrator
Site Admin
Posts: 4047
Joined: 04 Oct 2004, 18:38
Location: Thailand
Contact:

Re: Profile properties Window out of desktop

Post by Administrator »

Gaston wrote:After the change of configuration of my multihead desktop the properties window does open outside of th evisible desktop.
Please can you explain a "multihead desktop" for me? Many virtual desktops via software or do you have more than one display connected to your computer?

Have you activated the layout option "Save window position" to save the window position when you close AllSync?

What version of AllSync is installed?
Gaston
Posts: 10
Joined: 03 Dec 2004, 01:53

Post by Gaston »

Thanks for th eprompt reply. The "Save Layout" setting did solve the issue after retrieving the window. But as not everybody can write such a tool, and I don't know any function in Windows to retrieve a window from outside the desktop it migh tbe a good idea for Allsync to check this when it openes a window.

Sorry for forgetting the version, wich is the latest 2.7.3.

For the multihead, I have 2 monitors (multi head) attached to my computer. Initially my primanry monitor was to the right, which is "legal" for windows, but some programs have problems with such a configuration because the origin is not at the far left side, the left monitor having negative coordinates then.

This is why I have swapped the monitors and switched the primary to th emore standard right setting. Since I was running Allsync on the left monitor before, the coordinates of the windows where negative (at least for the profile window). Which results in the window bein outside of the visible dektop with the new configuration and cannot be accessed.
Administrator
Site Admin
Posts: 4047
Joined: 04 Oct 2004, 18:38
Location: Thailand
Contact:

Post by Administrator »

I think this is a rare setup because i never hear about this before from a user. You dont must write or use a special app to solve this problem. You can ask our support and we help you to fix the problem: delete the section [Form] at the file AllSync.ini to reset all window positions.
Gaston
Posts: 10
Joined: 03 Dec 2004, 01:53

Post by Gaston »

Well, it is not really important if it is rare or not, it is a valid setup anyway and a clean professional Application (which I account AllSync for :D )should be able to handle it.

In your case the applicationm was able to properly handle the initial configuration while otheres where not. The reason why I switcherd the monitors (with some problems I was not sure if the setupo was the cause, now after the switch I could verify it was the setup).

When I did this there where some applications, among which AllSync which did not handle the change correctly (i.e. left Windows outside of the desktop). Thats why the program was written.

Now in any case an application should check whether its window is inside the visible desktop when it opens it, and if not it should be moved there. This is not really very difficult to implement.

As Multihead becomes more and more popular this could avoid quite some problems. Imagine for example somebody with 2 Monitors and working with Allsync on the right one. Now oine monitor fails and until he gets a new one he switches to single monitor mode. As a result the Allsync window will be outside of his visible desktop and he will need support to solve this :cry:

Thus, an application should check if at least part of it is in the visible part of the desktop when the window is shown (or restored). This allows the user to drag the window (possibly after resizing it). If the window is completely outside it should be moved to the origin of the desktop. This can be done in a few lines of codes.

Best regards,
Gaston
Administrator
Site Admin
Posts: 4047
Joined: 04 Oct 2004, 18:38
Location: Thailand
Contact:

Post by Administrator »

Gaston wrote:Well, it is not really important if it is rare or not, it is a valid setup anyway and a clean professional Application (which I account AllSync for :D )should be able to handle it.
OK, you've convinced me. I try to find out how to check if a window is not visible on the desktop when someone uses a multimonitor desktop with negative position values. Maybe MS provides a API for this problem.
Gaston
Posts: 10
Joined: 03 Dec 2004, 01:53

Post by Gaston »

Administrator wrote:OK, you've convinced me. I try to find out how to check if a window is not visible on the desktop when someone uses a multimonitor desktop with negative position values. Maybe MS provides a API for this problem.
Oups, I think there is a missunderstanding here. The problem is not directly linked to the negative coordinates, which have been correctly handeled. The problem can basically occurs at any resolution change where the resolution is decreased, so as in the example above with th e two monitors and one breaks.

Basically GetWindowRect can be used to check the coordinates of the window and GetWindowPlacement to make sure the window is shown and not minimized. The SetWindowPos functions can then be used to change the placement if necessary.

To get the Desktop size you can use the GetDesktopWindow function to retrieve the desktop handle. From there you have two options. If you use GetWindowRect you will receive the actual desktop size, whicjh in case of multihead configuration may be restricted to only one display and is propbably the best guess to use for replacement of th ewindow if necessary.

However to check if the window is inside the visible area GetWindowPlacement of the desktopwindow is the correct value as rcNormalPosition gives you the complete visible part.

Best regards,
Gaston
Administrator
Site Admin
Posts: 4047
Joined: 04 Oct 2004, 18:38
Location: Thailand
Contact:

Post by Administrator »

Ok, problem fixed. The API "MonitorFromPoint" does the job well to determine if a window is visible or not.
Gaston
Posts: 10
Joined: 03 Dec 2004, 01:53

Post by Gaston »

Administrator wrote:Ok, problem fixed. The API "MonitorFromPoint" does the job well to determine if a window is visible or not.
Arghhh, Yes :D Thats the set of functions I was initially looking, obviously I did not use th eright serach criteria, I though they were Named Screen...something.

But in fact MonitorFromWindow with dwFlag=MONITOR_DEFAULTTONULL would even be easier to use in this case.
Administrator
Site Admin
Posts: 4047
Joined: 04 Oct 2004, 18:38
Location: Thailand
Contact:

Post by Administrator »

Gaston wrote:But in fact MonitorFromWindow with dwFlag=MONITOR_DEFAULTTONULL would even be easier to use in this case.
Not really if you want to check the saved left and top value before you set the new position of the window.
Post Reply