Problem resolution notes for Windows programming

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.