Settings dialog box Display location

Source: Internet
Author: User

Chipdlg is the Idd_hip_dialog class Chipdlg *m_hipdlg; Define First

M_hipdlg=new Chipdlg (this);

M_hipdlg->create (Idd_hip_dialog,this); Create dialog box

CRect Rcdlgs;
M_hipdlg->getwindowrect (RCDLGS); Gets the size of the Rect dialog box for the dialog box
ScreenToClient (RCDLGS); Turn the value of the screen to the corresponding actual value

int cx = GetSystemMetrics (Sm_cxscreen); Get the screen resolution
int cy = GetSystemMetrics (Sm_cyscreen);

CX CY, which is the value of x, y in the bottom right corner of the screen

M_hipdlg->movewindow (Cx-rcdlgs.width (), Cy-rcdlgs.height (), Rcdlgs.width (), Rcdlgs.height (), TRUE); //

The first two of the MoveWindow parameters are the X, y position of the dialog box

Three or four is the size of the dialog box, the last one without a tube.


M_hipdlg->setwindowpos (&wndtopmost,cx-rcdlgs.width (), Cy-rcdlgs.height (), Rcdlgs.width (), RcDlgs.Height (), Swp_nosize);

SetWindowPos first I wrote the meaning to make the dialog box top. I'm not going to write anything if I have to.

The back 4 is the same as MoveWindow.

The last one is the attribute I fill not let him change the size, the attribute has a lot, but cannot fill nomove, no//Can not move ...

MoveWindow and SetWindowPos choose one. Recommended latter


M_hipdlg->showwindow (Sw_show);


Okay, the dialog is in the lower right corner, and if the upper-left corner is

M_hipdlg->setwindowpos (&wndtopmost,0,0,rcdlgs.width (), Rcdlgs.height (), swp_nosize);

Related Article

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.