How to maximize a window after minimizing it

How to maximize a window after minimizing it? I use nCmdShow = 3 to maximize it, and nCmdShow = 6 to minimize it using ShowWindow(hwnd, nCmdShow) . However, as soon as I minimize the window, I cannot restore or maximize it.

Is this because I cannot save the handler for the minimized window so that the same window can be maximized under certain conditions? How to achieve the same?

+4
source share
3 answers

You want to use SW_RESTORE to redisplay a minimized window to quote MSDN :

Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should indicate this flag when restoring a minimized window.

+5
source

You need to call ShowWindow(Hwnd, SW_SHOWMAXIMIZED);

If you really cannot store the descriptor (is that what you meant by the handler?), Then you might consider using FindWindow . It sounds like you just need to save the window handle, and then everything will be fine!

+1
source

You can minimize the window by Alt + Enter and maximize the window with the same key combination.

-5
source

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


All Articles