LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam)
{
static HWND hBtn1,hBtn3;
switch (iMessage) {
case WM_CREATE:
hBtn1=CreateWindow("GrpBtn",NULL,WS_CHILD | WS_VISIBLE | GBS_PUSH,
10,10,16,16,hWnd,(HMENU)1,g_hInst,NULL);
SendMessage(hBtn1,GBM_SETIMAGE,MAKEWPARAM(IDB_BTN1NORMAL,IDB_BTN1HOT),
MAKEWPARAM(IDB_BTN1DOWN,IDB_BTN1DISABLE));
hBtn3=CreateWindow("GrpBtn",NULL,WS_CHILD | WS_VISIBLE | GBS_CHECK,
80,10,24,24,hWnd,(HMENU)3,g_hInst,NULL);
SendMessage(hBtn3,GBM_SETIMAGE,MAKEWPARAM(IDB_BTN3NORMAL,IDB_BTN3NORMAL),
MAKEWPARAM(IDB_BTN3DOWN,IDB_BTN3NORMAL));
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case 1:
...
break;
case 3:
if (SendMessage(hBtn3,GBM_GETSTATE,0,0) == GB_DOWN) {
...
} else {
...
}
break;
}
return 0;
...
}
return(DefWindowProc(hWnd,iMessage,wParam,lParam));
}