尝试其他版本
- (defun vva-MsgBox (Message Title Flags Timeout / WScript ret)
- ;;; Message - is the message to display
- ;;; Title - is the title of the Message Box
- ;;; Flags - is the bitwise number indicating the MessageBox Options
- ;;; Timeout - is a number (in seconds) to wait before automatically closing (0 = wait forever)
- ;;;Return values
- ;;;-1 Timed Out
- ;;;0 Error
- ;;;1 OK
- ;;;2 Cancel
- ;;;3 Abort
- ;;;4 Retry
- ;;;5 Ignore
- ;;;6 Yes
- ;;;7 No
- ;;;10 TryAgain
- ;;;11 Continue
-
- ;;;================ Flags ======================================
- ;;;Flags is a bitwise number indicating the various options.
- ;;;
- ;;;Options supported:
- ;;;
- ;;;Buttons values
- ;;;0 OK Only
- ;;;1 OK Cancel
- ;;;2 Abort Retry Ignore
- ;;;3 Yes No Cancel
- ;;;4 Yes No
- ;;;5 Retry Cancel
- ;;;6 Cancel TryAgain Continue
- ;;;
- ;;;Icon values
- ;;;0 No Icon
- ;;;16 Stop
- ;;;32 Question
- ;;;48 Exclamation
- ;;;64 Information
- ;;;
- ;;;
- ;;;Set Default Button (which button has focus and will return if user presses {enter} or {spc})
- ;;;0 First
- ;;;256 Second (defaults to first if no second button)
- ;;;512 Third (defaults to first if no third button)
- ;;;
- ;;;Message Box Modal Status
- ;;;0 Application
- ;;;4096 System (causes message box to remain topmost)
- ;;;
- ;;;Message Box Option Flags
- ;;;65536 Set MessageBox to Foreground
- ;;;131072 Show on Default Desktop only
- ;;;262144 Set MessageBox to TopMost
- ;;;524288 Right Align Text
- ;;;1048576 Right to Left Reading (think Chinese and Arabic)
- (setq WScript (vlax-create-object "WScript.Shell"))
- (setq ret (vlax-invoke WScript 'Popup Message Timeout Title Flags))
- (vlax-release-object WScript)
- ret
- )
- (defun vva-yes-no ( msg title )
- ;;; Message - is the message to display
- ;;; Title - is the title of the Message Box
- ;;; Return - t - Yes; nil - No
- ;;; Use: (vva-yes-no "Are you sure?" "Question" )
- (=
- (vva-MsgBox msg title (+
- 4 ;;; Yes No button values
- 32 ;;; Question Icon
- 256 ;;; No buttom defaults
- )
- 0
- )
- 6
- )
- )
|