12-05-2015, 09:24 AM
Not recommended, because a window should have 2 icons - 16x16 and 32x32. Ico files usually contain icons of these two sizes. But the bigger icon is not necessary if it is never displayed (eg in Alt+Tab window) or you don't care that it then looks not good because is auto-stretched.
Cannot set dialog icon through the icon parameter. Do it in dialog procedure.
Function Dialog197
Cannot set dialog icon through the icon parameter. Do it in dialog procedure.
Function Dialog197
__ImageList k16.Load(":10 $qm$\il_qm.bmp")
__Hicon hi16=ImageList_GetIcon(k16 4 0)
;__ImageList k32.Load(":10 $qm$\il_qm_32x32.bmp")
;__Hicon hi32=ImageList_GetIcon(k32 4 0)
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040304 "*" "" "" ""
if(!ShowDialog(dd &sub.DlgProc 0)) ret
#sub DlgProc v
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,SendMessage hDlg WM_SETICON 0 hi16
,;SendMessage hDlg WM_SETICON 1 hi32
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1