05-18-2021, 11:48 PM
use thread handle insteadÂ
Macro EndThreadSub
Macro EndThreadSub
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 132 84 "Dialog" "4"
;3 Static 0x54000000 0x0 40 10 56 12 "Text"
;4 Button 0x54032000 0x0 16 24 103 37 "Click here to stop count (works in QM but not in .exe, different thread name ?)"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C00 "*" "" "" ""
if(!ShowDialog(dd &sub.DlgProc 0)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,int- hThread=mac("sub.counting" "" hDlg)
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 4 ;;Click here to stop count
,EndThread("" hThread)
ret 1
#sub counting
function hdlg
rep
,_i+1
,_s=F"{_i}";_s.setwintext(id(3 hdlg))
,1