Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Performing time-consuming commands or sub-functions from button in dialog
#2
run the code from subfunction in a separate thread using mac

Function Function54
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Button 0x54032000 0x0 16 16 48 14 "Run wmic"
;4 Button 0x54032000 0x0 112 16 64 14 "Run subFunction"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""

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


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3 ;;Run wmic
,mac "sub.subTest1"
,case 4 ;;Run subFunction
,mac "sub.subTest2"
ret 1

#sub subTest1
str cl=
;wmic PRODUCT where "name='APP name'" call Uninstall
RunConsole2 cl

#sub subTest2
rep 20
,0.5


Messages In This Thread
RE: Performing time-consuming commands or sub-functions from button in dialog - by Kevin - 09-22-2023, 02:35 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)