How does one maximize a window after minimizing it? I use nCmdShow = 3
to maximize it and nCmdShow = 6
to minimise it using ShowWindow(hwnd, nCmdShow)
. However, once I minimize the window, I cannot restore or maximize it.
This is because I cannot store the handler for the window that is minimized so that the same window can be maximized on certain condition? How do I achieve the same thing?
You want to use SW_RESTORE
to redisplay your minimized window, to quote MSDN:
Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
You need to call ShowWindow(Hwnd, SW_SHOWMAXIMIZED);
If you really "cannot store the handle" (is that what you meant by handler?) then you could consider using FindWindow. Sounds to me like you need to just store the window handle and then it'll be OK!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With