07-11-2014, 04:20 PM
Function dlg_MD5_Hash
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str controls = "3"
str e3
if(!ShowDialog("dlg_MD5_Hash" &dlg_MD5_Hash &controls)) ret
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 230 196 "Dialog"
;3 Edit 0x54030080 0x200 66 144 158 16 ""
;5 ListBox 0x54230101 0x200 6 9 218 128 ""
;4 Static 0x54000200 0x0 6 144 54 16 "MD5 Hash Value"
;1 Button 0x54030001 0x0 147 168 48 14 "OK"
;2 Button 0x54030000 0x0 87 168 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040108 "" "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,,ARRAY(str) exeList; int i
,,str initdir="$my qm$"
,,if(!BrowseForFolder(_s initdir 4)) ret
,,GetFilesInFolder exeList _s "*.exe"
,,for i 0 exeList.len
,,,LB_Add id(5 hDlg) exeList[i]
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case LBN_SELCHANGE<<16|5 ;;this code is created with the Events button in the Dialog Editor
,_i=LB_SelectedItem(lParam)
,,str item
,,LB_SelectedItem(id(5 hDlg) item)
,,str s.encrypt(2|8 item "" 0x100)
,,s.setwintext(id(3, hDlg))
,,e3.getwintext(id(3, hDlg))
,,out e3
,,;3 ;;don't use wait in dialogs
,;case 2 end ;;don't use end to end dialog
,case IDOK
,;ret 0 ;;return 0 if don't want to close dialog on OK
,case IDCANCEL
ret 1