IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 294, 150
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 10, "System"
BEGIN
...
CONTROL 104,IDC_STATIC2,"Static",SS_BITMAP,220,15,62,80
// ICON IDI_ICON1,IDC_STATIC,185,90,20,20
END
IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 187, 98
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 10, "System"
BEGIN
...
ICON "",IDC_STICON,73,32,20,20
END
BOOL CALLBACK MainDlgProc(HWND hDlg,UINT iMessage,WPARAM wParam,LPARAM lParam)
{
static int Frame=0;
static HICON arIcon[11];
int i;
switch (iMessage) {
case WM_INITDIALOG:
for (i=0;i<11;i++) {
arIcon[i]=LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_ICON1+i));
}
SetTimer(hDlg,1,200,NULL);
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
case IDCANCEL:
EndDialog(hDlg,0);
return TRUE;
}
break;
case WM_TIMER:
SendDlgItemMessage(hDlg,IDC_STICON,STM_SETICON,(WPARAM)arIcon[Frame], 0);
/* SendDlgItemMessage(hDlg,IDC_STICON,STM_SETIMAGE,(WPARAM)IMAGE_ICON,
(LPARAM)arIcon[Frame]); */
Frame++;
if (Frame == 11) Frame=0;
return TRUE;
}
return FALSE;
}