Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialogs that disable the dialog it was called from
#1
How do you go about creating a dialog that has a button to open a new dialog that while the new dialog is open, the original dialog is disabled.

For example, the way the "Save As" dialog works in windows.

Thanks,
Jimmy Vig
#2
When dialog1 is owner of dialog2, dialog1 is disabled.
ShowDialog "dialog2" ... dialog1handle
#3
Wow...so simple. That will make a lot of things run so much more smoothly. I should have asked ages ago!
#4
I dont understand? Dialog3 is the first window opened, a button on dialog3 opens dialog4, so...

if(!ShowDialog("Dialog4" &Dialog4 &controls)) ret

goto this?

if(!ShowDialog("Dialog4" &Dialog3 &controls)) ret
#5
4-th argument of ShowDialog must be hDlg
then hDlg will be owner of the new dialog
#6
Perfect, thank you.
#7
Function Dialog2
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("Dialog2" &Dialog2)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 8 12 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
,if(!ShowDialog("Dialog2" &Dialog2 0 hDlg)) ret

,case IDOK
,case IDCANCEL
ret 1
#8
How do you get a second dialog with a minimize box to minimize both the current dialog and the disabled parent dialog...
#9
In dialog2 insert OutWinMsg to see what messages it receives when minimizing. Possibly it is WM_SYSCOMMAND with certain code. Read about it in MSDN. When the message is received, minimize owner: min GetWindow(hDlg GW_OWNER).


Forum Jump:


Users browsing this thread: 1 Guest(s)