Page 1 of 1

TC 9.51 does not save the size and position of its window

Posted: 2020-12-02, 05:46 UTC
by Vladislav Vasilyev
On one of the computers with Windows Server 2012 R2 Total Commander 9.51 64-bit does not save its window size and position. In the file wincmd.ini after executing the command "Save position" the same window coordinates are always spelled out:

[1920x1080 (8x16)]
maximized=0
x=0
y=13
dx=1920
dy=876

The same problem occurs in Windows 10 when the system font scale is set to other than 100%.

However, on the other Windows Server 2012 R2 computer, the size is saved:
[1920x1080 (8x16)]
maximized=0
x=451
y=0
dx=1469
dy=1050

It is strange that in the second case dx=1469, not 1920, although the TC window is aligned with the right edge of the screen, which operates in 1920x1080 mode.

The need to re-adjust the size and position of the window after each TC start is annoying. Could you figure out why saving doesn't work and fix the bug?

Re: TC 9.51 does not restore the size and position of its window

Posted: 2020-12-02, 13:00 UTC
by petermad
Maybe you have the wincmd.ini parameter ResolutionSpecific set to zero on the first computer - then the settings are saved in the [AllResolutions] section.



It is strange that in the second case dx=1469, not 1920
dx is not the coordinate of the right corner it is the width of TC. So screen width - x = dx (1920 - 451 = 1469 ).

Posted: 2021-01-06, 07:45 UTC
by Vladislav Vasilyev
On a computer where the size and position of the Total Commander window is not saved, the "ResolutionSpecific" parameter is absent in the wincmd.ini file, the coordinates in the [AllResolutions] section are absent. In the [1920x1080 (8x16)] section only the "maximized" and "Tabstops" parameters are saved, other coordinates always remain constant:
[1920x1080 (8x16)]
maximized=0
x=455
y=4
dx=1467
dy=800

Posted: 2021-01-06, 07:53 UTC
by Vladislav Vasilyev
I wrote the previous post while connected to Windows Server 2012 R2 via RDP.
I have an idea: could it be that Total Commander behaves so strangely due to its remote desktop mode? Connected to the server console using the latest version of TeamViewer - the window coordinates were saved. Just when I was happy that my hunch was confirmed, I closed TeamViewer connection and reconnected via RDP - oh, my goodness! - window coordinates are now saved in the RDP session as well.

I don't get it! How can that be?

Re:

Posted: 2021-01-06, 08:56 UTC
by HolgerK
Vladislav Vasilyev wrote: 2021-01-06, 07:53 UTC How can that be?
One possible cause is that you used the windows snapping feature (dragging the TC-window to the left/right side/edge of the screen) and than resized the TC-window while snapping to one of the screen borders was still active.
TC has some problems to get the actual window position in conjunction with window snapping.

Regards
Holger

Re: TC 9.51 does not save the size and position of its window

Posted: 2021-01-07, 16:45 UTC
by ghisler(Author)
When using window snapping, the functions asking for window position (GetWindowPlacement) return the coordinates of the not snapped window, not those of the snapped window. I guess that they are the size stored in the ini file.

Re: TC 9.51 does not save the size and position of its window

Posted: 2021-01-12, 12:47 UTC
by Vladislav Vasilyev
Thank you, you were right. Snap to Side was the culprit. To turn it off, open "Control Panel/All Control Panel items/Special Features/Mouse Simplification" and check "Disable automatic ordering of windows when they are moved to screen boundaries" (Russian to English translation). Or, if through the registry:

[HKEY_CURRENT_USER\Control Panel\Desktop]
"WindowArrangementActive"="0"

Problem solved!