Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to close the dialog
#1
When the dialog box opens, when I press ESC or Enter, the dialog box closes, so I change the return value of sel wParam to 0

As a result, the dialog cannot be closed. How can I close the dialog? Thanks in advance  Smile

Macro Macro1
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 642 318 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 642 318 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD

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


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3.Navigate("www.quickmacros.com")
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 0
#2
which are you trying to prevent from closing the dialog enter or escape?
enter is linked to IDOK ,escape is linked to IDCANCEL

better to allow dialog to work as its intended 
 and do do like this
use WM_CLOSE 
Function Function101
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 642 318 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 642 318 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""
str controls = "3"
str ax3SHD
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,we3.Navigate("www.quickmacros.com")
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ret 0
,case IDCANCEL
,ret 0
ret 1
the last ret has to be 1 
I believe this is the way it should be done. Gintaras correct me if i am wrong
#3
Normal use, no problems found, thanks Heart


Forum Jump:


Users browsing this thread: 1 Guest(s)