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/>