Problem directory:
- 1. How to hide and show windows
1. How to hide and show windows
(First the program frame refer to another blog post)
SetWindowPos ( _in_ hwnd hwnd, _in_opt_ hwnd hwndinsertafter, //z axis position such as hwnd_topmost _in_ int X, _in_ int Y, _in_ int cx, //nwidth _in_ int cy,//nheight _in_ UINT uflags //can set hidden and explicit display window);
GetWindowRect ( _in_ hwnd hwnd, _out_ LPRECT LPRECT);
To use SetWindowPos to hide and show windows in the same location, you can use the GetWindowRect function together:
GetWindowRect (hwnd3,&rect3);
SetWindowPos (Hwnd3,hwnd_topmost,rect3.left,rect3.top,rect3.right-rect3.left,rect3.bottom-rect3.top,SWP_ Hidewindow);
SetWindowPos (Hwnd3,hwnd_topmost,rect3.left,rect3.top,rect3.right-rect3.left,rect3.bottom-rect3.top,SWP_ ShowWindow);
Show and hide Windows a simple function is ShowWindow.
ShowWindow ( _in_ hwnd hwnd, _in_ int ncmdshow);
This can be achieved simply by following the code:
ShowWindow (Hwnd2,sw_hide); ShowWindow (Hwnd2,sw_show);
Problem resolution notes for Windows programming