IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 187, 98
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 10, "System"
BEGIN
DEFPUSHBUTTON "OK",IDOK,130,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,130,24,50,14
PUSHBUTTON "Button1",IDC_BUTTON1,25,40,40,40,BS_BITMAP
// PUSHBUTTON "Button2",IDC_BUTTON2,70,40,40,40,BS_ICON
END
BOOL CALLBACK MainDlgProc(HWND hDlg,UINT iMessage,WPARAM wParam,LPARAM
lParam)
{
static HBITMAP s_hBtnBit;
switch (iMessage) {
case WM_INITDIALOG: {
// HICON hIcon;
hBtnBit = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_BITMAP1));
SendDlgItemMessage(hDlg, IDC_BUTTON1, BM_SETIMAGE,
(WPARAM)IMAGE_BITMAP,
(LPARAM)s_hBtnBit);
/*
hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON1));
SendDlgItemMessage(hDlg, IDC_BUTTON2, BM_SETIMAGE,
(WPARAM)IMAGE_ICON, (LPARAM)hIcon); */
}
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
case IDCANCEL:
DeleteObject(hBtnBit);
EndDialog(hDlg, 0);
return TRUE;
case IDC_BUTTON1:
MessageBox(hDlg,TEXT("비트맵 버튼을 클릭했습니다"), TEXT("알림"), MB_OK);
return TRUE;
/*
case IDC_BUTTON2:
MessageBox(hDlg,TEXT("아이콘 버튼을 클릭했습니다"), TEXT("알림"), MB_OK);
return TRUE; */
}
return FALSE;
}
return FALSE;
}