Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set/Reset Icon & Text to "OK" button
#9
Macro Draw dialog button icon
Code:
Copy      Help
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: "" 0x2040308 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,__Hicon- t_hi=GetFileIcon("$qm$\paste.ico")
,SetWindowSubclass(id(1 hDlg) &sub.WndProc_Subclass 1 0)
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


#sub WndProc_Subclass
function# hwnd message wParam lParam uIdSubclass dwRefData

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass uIdSubclass)
,
,case WM_PAINT
,int dc=GetDC(hwnd)
,__Hicon- t_hi ;;out t_hi
,DrawIconEx(dc 4 4 t_hi 0 0 0 0 DI_NORMAL)
,ReleaseDC hwnd dc

ret R


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)