本帖最后由 作者 于 2004-2-21 23:47:32 编辑
函数:(MsgBox msg timeout title buttons)
- ;;;Buttons
- ;;;
- ;;;0 OK
- ;;;1 OK and Cancel
- ;;;2 Abort, Retry, and Ignore
- ;;;3 Yes, No, Cancel
- ;;;4 Yes and No
- ;;;5 Retry and Cancel
- ;;;
- (setq bt_OK 0
- bt_OK_Cancel 1
- bt_Abort_Retry_Ignore 2
- bt_Yes_No_Cancel 3
- bt_Yes_No 4
- bt_Retry_Cancel 5
- )
- ;;;Icon Types
- ;;;
- ;;;16 Stop Mark icon
- ;;;32 Question Mark icon
- ;;;48 Exclamation Mark icon
- ;;;64 Information Mark icon
- (setq icon_Stop 16
- icon_Question 32
- icon_Exclamation 48
- icon_Information 64
- )
- ;;;1 OK button
- ;;;2 Cancel button
- ;;;3 Abort button
- ;;;4 Retry button
- ;;;5 Ignore button
- ;;;6 Yes button
- ;;;7 No button
- (setq rs_OK 1
- rs_Cancel 2
- rs_Abort 3
- rs_Retry 4
- rs_Ignore 5
- rs_Yes 6
- rs_No 7)
- (defun msgbox ( msg timeout title buttons / ws)
- (setq ws (vlax-create-object "wscript.shell"))
- (vlax-invoke-method ws 'popup msg timeout title buttons)
- )
- ;;; test
- ;;;(if (= (msgbox "This is a test line." 5 "Qiu Feng" (+ bt_OK_Cancel Icon_Question))
- ;;; rs_OK)
- ;;; (alert "You select OK")
- ;;; (alert "You select Cancel")
- ;;;)
|