Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Force closure of sub-function before returning to main dialog
#1
Hello !

Just a quick question :

In this example, i would like for the user to not be able to return to "Dialog1" until he closes "Dialog2"

Can you show me how can i do it ?

Thanks Smile

Macro Dialog1
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog1"
;3 Button 0x54032000 0x0 64 40 90 42 "Button"
;4 Static 0x54000000 0x0 88 20 48 13 "Dialog1"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

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


#sub Dialog1
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3 ;;Button
,,sub.Dialog2(2)
ret 1




#sub Dialog2
function# [hwndOwner]

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 206 108 "Dialog2"
;3 Static 0x54000001 0x0 16 20 162 80 "You should not be able to return to Dialog1 until this window is closed."
;4 Static 0x54000000 0x0 72 4 48 13 "Dialog 2"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc2 0 hwndOwner)) ret

ret 1


#sub DlgProc2
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
ret 1
#2
It seems that i found it myself Smile

Don't know if it's the proper way to do it, but it works :


Macro Dialog1
Code:
Copy      Help
,,sub.Dialog2 hDlg
,,;;instead of
,,sub.Dialog2


Forum Jump:


Users browsing this thread: 1 Guest(s)