[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[注册表类] 求助!wBox怎么用?

如题,不知怎么使用,求大神帮助!

哦对了顺便帮忙翻译一下以下代码,非常感谢!
  1. @echo off
  2. echo +++ Wbox Demo batch +++
  3. echo.
  4. wbox "Wbox Demo" "Wbox displays a message box with buttons, and returns an ''Errorlevel'' according to the selected button (number 1..)" "Continue;Options;Cancel"
  5. echo Errorlevel: %errorlevel%
  6. goto Action_%errorlevel%
  7. :Action_1
  8. Wbox "Demo" "The size of the box is adjusted depending on text size and number of buttons. Corrections are possible by options" Ok /fs=11  /fc=#002266
  9. echo Errorlevel: %errorlevel%
  10. if not errorlevel 1 goto :eof
  11. :Action_2
  12. Wbox "" "Available options:^^- button width^- window width^- font size, color^- number of text lines^- background color^- left aligned text^- time-out" "Quit -$-" /AL /TM=10 /BG=#FFCCBB /FC=#440044 /ot
  13. echo Errorlevel: %errorlevel%
  14. goto :eof
  15. :Action_3
  16. goto :eof
  17. :action_0
  18. :action_255
  19. pause
复制代码

TOP

  1. Wbox "我是标题" "我是内容" "我是按钮1;我是按钮2"
复制代码

TOP

Wbox - Ver. 1.11 - Message box for batch - (c) 2011-2013, Horst Schaeffer
-------------------------------------------------------------------------

Wbox displays a window with a message text and a number of buttons. The selected button (number 1..) is returned as Errorlevel.

The box is displayed in the middle of the command window. If the console window is minimized or hidden, the box will show in the middle of the desktop.

Window title, message text and button caption are specified as command parameters, for example:

     Wbox "Backup" "Accounting data saved" "Continue;Quit"

General syntax:

     Wbox title message buttons [options]

The title will show in the window's title bar. If you leave it empty (""), "Wbox" is inserted.

The message will be wrapped to several lines if necassary. The caret symbol (^) forces a line feed (alternative token see option /CR). Wbox tries to produce an optimal sizing; however, options are available for adjustments.

The buttons must be separated by semicolons, for example: "Yes;No;Cancel"

Each of the three command arguments should be enclosed in (double) quote marks to make sure that each is interpreted as one parameter unit.

Options (a value requires an equal sign):

     /AL    align left (default: message text centered)
     /OT    on top: keep window on top
     /TM=   time-out (seconds), see notes below
     /DB=   default button (will have the focus at start), default: /DB=1
     /TL=   forces (space for) the given number of text lines, e.g. /TL=3
     /FS=   font size; default: /FS=9
     /FF=   fixed spaced font (Lucida Console)   
     /CR=   sets the line break token, default: /CR=^
     /BW=   button width (pixels); default: auto
     /WW=   minimum window width (pixels), default: /WW=200
            (normally, the width is calculated acc. to the button width)
     /BG=   background color, hexadecimal with hash sign (same as for HTML);
            example: /BG=#FFCCBB
     /FC=   font color, same code as for /BG, default: /FC=#000000
     /DX=   hotizontal window position plus/minus pixels (example /dx=+100)
     /DY=   vertical window position plus/minus pixels (example /dy=-80)
     
Options (case ignored) must be separated by space(s), no commas! No space within an option!

The exit code (Errorlevel) is the number of the selected button (1..).
Zero is returned if the Wbox window is closed by [x] (title bar) or Escape.

Syntax errors produce a Wbox with error information, erorlevel 255.
Once you tested the command sucessfully, this error will not occur, so you need not check it in your regular batch file.


Timer:

Option /TM starts a timer with the given number of seconds, for example, /TM=6. At time-out the window closes returning the default button number as errorlevel. The timer is halted when a key is pressed (not Escape or Enter), or a mouse mouse button is clicked in the window (not on a button).

The countdown can be displayed by inserting the "$" token in one of the buttons, for example: "Cancel -$-".


Keyboard handling:

Change focus with TAB or Shift+TAB. Initially, the focus is set to the button specified by option /DB.

Enter selects the button with the focus, and closes the window.
Escape exits with errorlevel zero.


Special text symbols:

Caret (^) or alternative token forces a line feed.
Two single quote marks ('') are converted to one double quote mark.


Colors:

If you are not familiar with the color codes, try a web tool like this: http://www.colortools.net/color_picker_web-safe.html


History

ver. 1.11  2012/03/26  Option /FC
ver. 1.10  2012/03/26  Option /OT
ver. 1.07  2011/10/28  Options /DX, /DY
ver. 1.06  2011/09/27  Default button was initially not marked
ver. 1.05  2010/11/27  Option: fixed spaced font
ver. 1.04  2010/10/17  Bugfix: default button highlighting; /CR= option; Font
ver. 1.03  2010/08/18  box screen centered also if CMD window hidden
ver. 1.02  2010/08/13  Bugfix: timer without countdown token wiped out text
ver. 1.00  2010/03/28  


Disclaimer

This program is freeware (c) Horst Schaeffer. No warranty, no liability of any kind.
PureBasic Source: http://www.horstmuc.de/source/wbox111.zip

mailto:horst.schaeffer@gmx.net
http://www.horstmuc.de/

18 Jun 2013

TOP

返回列表