I know it is a very old thread, but with Patrice's routine I cannot get the
timer option to work.
I have this as a workaround, now the timer works, but I cannot have
the return value if you pressed one of the buttons.
;;;***************************************************************************;
;;; MsgBox by Patrick_35 ;
;;; ;
;;; Val options ;
;;; 0 vlax-vbOKOnly ;
;;; 1 vlax-vbOKCancel ;
;;; 2 vlax-vbAbortRetryIgnore ;
;;; 3 vlax-vbYesNoCancel ;
;;; 4 vlax-vbYesNo ;
;;; 5 vlax-vbRetryCancel ;
;;; 16 vlax-vbKatakana ;
;;; 32 vlax-vbQuestion ;
;;; 48 vlax-vbExclamation ;
;;; 64 vlax-vbInformation ;
;;; ;
;;; Modified so the timer works by ymg ;
;;; However always returns 0, so cannot detect which button was pressed. ;
;;;***************************************************************************;
(defun MsgBox (title options message time / rtn WshShell)
(setq WshShell (vlax-create-object "WScript.Shell"))
(vlax-invoke WshShell 'Run
(strcat "mshta.exe vbscript:close(CreateObject(\"WScript.Shell\").Popup(\""
message "\"," (itoa time) ",\"" title "\"," (itoa options)"))"
)
)
(vlax-release-object WshShell)
)