[Reprinted] the dialog box without Borders changes the size.

Source: Internet
Author: User

To achieve the effect, you need to process the following three messages:

Wm_nchittest wm_setcursor wm_nclbuttondown

Message Processing functions:

 

Uint cxxxdlg: onnchittest (uint nhittest, cpoint point) <br/>{< br/> crect rect; <br/> getwindowrect (& rect ); <br/> If (point. x <= rect. left + 3) <br/> return htleft; <br/> else if (point. x> = rect. right-3) <br/> return htright; <br/> else if (point. Y <= rect. top + 3) <br/> return httop; <br/> else if (point. y> = rect. bottom-3) <br/> return htbottom; <br/> else if (point. x <= rect. left + 10 & Point. Y <= rect. top + 10) <br/> return httopleft; <br/> else if (point. x> = rect. right-10 & Point. Y <= rect. top + 10) <br/> return httopright; <br/> else if (point. x <= rect. left + 10 & Point. y> = rect. bottom-10) <br/> return htbottomleft; <br/> else if (point. x> = rect. right-10 & Point. y> = rect. bottom-10) <br/> return htbottomright; </P> <p> return 0; <br/>}</P> <p> bool cxxxdlg :: onsetcursor (hwnd, uint nhittest, uint message) <br/> {<br/> If (nhittest = htcaption | nhittest = htsysmenu | <br/> nhittest = htmenu | nhittest = htclient) <br/>{< br/> setcursor (loadcursor (null, makeintresource (idc_arrow ))); <br/>}< br/> else if (nhittest = httop | nhittest = htbottom) <br/>{< br/> setcursor (loadcursor (null, makeintresource (idc_sizens); <br/>}< br/> else if (nhittest = htleft | nhittest = htright) <br/>{< br/> setcursor (loadcursor (null, makeintresource (idc_sizewe ))); <br/>}< br/> else if (nhittest = httopleft | nhittest = htbottomright) <br/>{< br/> setcursor (loadcursor (null, makeintresource (idc_sizenwse); <br/>}< br/> else if (nhittest = httopright | nhittest = htbottomleft) <br/>{< br/> setcursor (loadcursor (null, makeintresource (idc_sizenesw ))); <br/>}< br/> else <br/>{< br/> setcursor (loadcursor (null, makeintresource (idc_arrow ))); <br/>}</P> <p> void cxxxdlg: onnclbuttondown (uint nhittest, cpoint point) <br/>{< br/> If (nhittest = httop) <br/> sendmessage (wm_syscommand, SC _size | wmsz_top, makelparam (point. x, point. y); <br/> else if (nhittest = htbottom) <br/> sendmessage (wm_syscommand, SC _size | wmsz_bottom, makelparam (point. x, point. y); <br/> else if (nhittest = htleft) <br/> sendmessage (wm_syscommand, SC _size | wmsz_left, makelparam (point. x, point. y); <br/> else if (nhittest = htright) <br/> sendmessage (wm_syscommand, SC _size | wmsz_right, makelparam (point. x, point. y); <br/> else if (nhittest = httopleft) <br/> sendmessage (wm_syscommand, SC _size | wmsz_topleft, makelparam (point. x, point. y); <br/> else if (nhittest = httopright) <br/> sendmessage (wm_syscommand, SC _size | wmsz_topright, makelparam (point. x, point. y); <br/> else if (nhittest = htbottomleft) <br/> sendmessage (wm_syscommand, SC _size | wmsz_bottomleft, makelparam (point. x, point. y); <br/> else if (nhittest = htbottomright) <br/> sendmessage (wm_syscommand, SC _size | wmsz_bottomright, makelparam (point. x, point. y); <br/>}< br/>

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.