D
D
Dmitry Korolev2019-06-11 16:01:48
Windows
Dmitry Korolev, 2019-06-11 16:01:48

Why is the window minimized and not maximized?

On a form with border-style: none; what happens is that it collapses and does not expand when I turn off the other monitor.
How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Korolev, 2019-06-18
@adressmoeistranici

First you press the key combination Win + Shift + Right / Left in the window and you don’t want it to move to another screen.
You process the wm_windowpositionchanged type message in wndproc if the message argument points to the wrong screen with the position, then you insert the position from the form properties into the argument. After that, your minimized window accepts (-32000, -32000, icon width, taskbar icon height) and this code is called in vndproc when the monitor is turned off, then you unfold it from minimized and do not see it, since such a window position was used. It remains just to dodge, store the window rect in your variable and apply it when you activate the window or strengthen the condition in vndproc. But I was afraid of the latter and used the first option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question