Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Solved)...How can Change Icon Dialog be used in QM
I have a macro that the user needs to select an icon from a .dll or .exe file. Can the Change Icon Dialog be used in QM?

[Image: changeiconuk5.jpg]
Function ChooseIconDialog
Copy      Help
function# str&path &index [$defaultpath] [defaultindex] [hwndOwner]

;Shows 'Change Icon' dialog.
;Returns 1 on OK, 0 on Cancel.

;path - str variable that receives icon file path.
;index - int variable that receives icon index.
;defaultpath, defaultindex - can be used to initialize the dialog.
;hwndOwner - handle of owner window or 0.

;str s; int i
;if(!ChooseIconDialog(s i)) ret
;out "%s,%i" s i

dll shell32 [62]#PickIconDlg_NT hwnd @*pszIconPath cbIconPath *piIconIndex
dll shell32 [62]#PickIconDlg_9x hwnd $pszIconPath cbIconPath *piIconIndex

str sd.expandpath(defaultpath); if(sd.len>MAX_PATH) sd.all

,BSTR b.alloc(MAX_PATH); b[0]=0
,if(sd.len) sd.unicode; memcpy b.pstr sd sd.len+2
,if(!PickIconDlg_NT(hwndOwner b.pstr MAX_PATH+1 &index)) ret
,sd.set(0 sd.len MAX_PATH)
,if(!PickIconDlg_9x(hwndOwner sd MAX_PATH+1 &index)) ret

ret 1
wow! Confusedhock: Thanks so much.

Is this something you already had or did you just make this ?

Forum Jump:

Users browsing this thread: 1 Guest(s)