Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
clo hDlg
#1
My dialog runs a different dialog on the press of a button but then closes itself right after it, i think it closes the one that it opened also...anyway to make it not close the second one?

It only happens in exe...

Examples...

.qml file...

.qml   New Folder.qml (Size: 1.48 KB / Downloads: 298)

once you make it into exe it closes both of them but in qm it only closes the first one like its suppose to
#2
mac starts another thread. Then main thread exits. When main thread exits, program ends. Somehow make that main thread would not exit, eg wait for dialog2. Or don't use mac, let dialog2 run in the same thread.
#3
ok i used wait for the second dialog to open, but it still closes both of them when i use clo hDlg to close the second one.
#4
wait for the second dialog to CLOSE
#5
how would i go about making dialog2 run in a thread and NOT close dialog2 when dialog1 closes.
#6
you better hide dialog1, don't close
#7
closing example
Function dlg_564_main
Code:
Copy      Help
;/exe
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

ShowDialog("dlg_564_main" &dlg_564_main 0)

rep
,1
,if(IsThreadRunning("dlg_564_2")) continue
,;if(IsThreadRunning("dlg_564_3")) continue
,;if(IsThreadRunning("dlg_564_4")) continue
,;...
,break


;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog main"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 12 10 48 14 "dialog2"
;END DIALOG
;DIALOG EDITOR: "" 0x2030006 "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,mac "dlg_564_2"
,clo hDlg
,
,case IDOK
,case IDCANCEL
ret 1
#8
i figured out a way using hide, i will try using the IsThreadRunning and see if i can get that.
thanks
#9
i have exactly the same problem, ive tried all diffrent ways to try close or hide it,il try the "IsThreadRunning" example,did you figure out how to hide the first dialog QM_Expert other then the "IsThreadRunning"?
VεRiTλS
#10
make your first dialog, then make your second dialog, then call your second dialog as a mac from a control of the first dialog, to fix the problem with the first dialog closing do this in second dialog:

sel message
,case WM_INITDIALOG
,hid win("YOU FIRST DIALOG NAME HERE" "#32770")
,DT_Init(hDlg lParam) ;;*
,ret 1 ;;*
,case WM_DESTROY DT_DeleteData(hDlg) ;;*
,res win("YOU FIRST DIALOG NAME HERE" "#32770")
,case WM_COMMAND goto messages2

this will allow the first dialog to hide when the second dialog opens and it will unhide when second dialog closes!
hope this helps!


Forum Jump:


Users browsing this thread: 1 Guest(s)