Value SW_SHOW and SW_SHOWNORMAL

In my applications, I sometimes use: ShowWindow(MyForm.Handle, SW_SHOW) .

The documentation for the ShowWindow function has a section for SW_SHOWNORMAL that states

"The application should indicate this flag when displaying the window for the first time."

Does this mean that for each form (which I switch to ShowWindow ) I need to save a boolean var to see if the form was shown or not, and based on this, should I use SW_SHOW or SW_SHOWNORMAL ?

What is the deep meaning of SW_SHOWNORMAL ?

+4
source share
2 answers

The term normal is synonymous with restored. This terminology goes back to older versions of windows, and currently all MSDN documentation uses restored, not normal or normalized.

So, SW_SHOWNORMAL sets the state of the recovery window and makes the window visible. SW_SHOW , SW_SHOW other hand, simply makes the window visible.

On the same day, the restored one was called normalized, the minimized one was called iconic, and the maximization was called full screen. If memory is used, this old terminology is still used in Windows 3.1, but has been modified using Windows 95 and NT.

+13
source

SW_SHOW often used in combination with SW_HIDE , so if for some reason you showed / hid the window (for example, based on user action), you would use them in tandem. SW_SHOWNORMAL was originally used in the "old" days when the window first appeared.

SW_SHOWNORMAL sometimes valuable if you want to make sure that the window is not minimized (or maximized) at a specific point in the program (for example, if the window can be minimized, but you want to β€œrestore” it so that the user can interact with it )

+5
source

Source: https://habr.com/ru/post/1489896/


All Articles