Is it possible to have custom dialog shapes such as a circle or a triangle?
Is it possible to have custom dialog shapes such as a circle or a triangle?
Your best bet would be to use a bitmap that represents the states of your button and blit it. Then when you get a WM_LBUTTONDOWN message check PtInRect (or a series of depending on how complicated your shape is) to see if the mouse was inside your custom shape.
You can use Regions to change the shape of any window. For example:
Shove that chunklet into your WM_CREATE or WM_INITDIALOG and your window or dialog will be round (based on window/dialog dimensions). All Hit-testing for that wnd/dlg will occur only for that region.Code:RECT rc; GetClientRect(hwnd,&rc); HRGN hrgn=CreateEllipticRgnIndirect(&rc); HDC hdc=GetDC(hwnd); SetWindowRgn(hwnd,hrgn,0); ReleaseDC(hwnd,hdc); DeleteObject(hrgn);
Last edited by Ken Fitlike; 05-09-2002 at 01:07 PM.