国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

vbs-toolkit VBSEdit 提供 免費的COM組件

2020-06-26 17:16:13
字體:
來源:轉載
供稿:網友

VBSCRIPT 語法簡單 強大 但是功能上明顯不足 需要第三方的控制 e.g. COM 組件來擴展其功能. VBSEDIT 安裝完之后就可以在安裝目錄下發現 免費提供的 COM 組件 vbs toolkit.

下載 VBSEDIT 工具

32 位 DLL: vbsedit32 60 VBSEdit 提供
64 位 DLL: vbsedit64 61 VBSEdit 提供

注冊組件

注冊組件需要管理員權限. 可以運行下面命令分別注冊 32, 64 位的VBSEDIT 工具箱.

regsvr32 vbsedit32.dll
regsvr32 vbsedit64.dll

注銷的時候則需要 加 /u 參數

regsvr32 /u vbsedit32.dll
regsvr32 /u vbsedit64.dll

提供了一些方便的功能擴展 比如剪貼板.

Set toolkit = CreateObject("VbsEdit.Toolkit")toolkit.PutClipboardText "Hello World" WScript.Echo toolkit.GetClipboardText() 

CLIPBOARD OPERATIONS

GetClipboardText method

1、獲取剪切板中的文本內容

Set toolkit = CreateObject("VbsEdit.Toolkit")WScript.Echo toolkit.GetClipboardText() 

PutClipboardText method

2、將指定內容設置到剪切板中

Set toolkit = CreateObject("VbsEdit.Toolkit")toolkit.PutClipboardText "Hello World"

運行后就將剪切板的數據設置為 Hello World

DIALOG BOXES

OpenFileDialog method
Prompt the user to open a file
toolkit.OpenFileDialog ([initialFolder,[filters,[multiselect,[title]]]])

'Opens a single fileSet toolkit = CreateObject("VbsEdit.Toolkit")files=toolkit.OpenFileDialog("c:/scripts/","Text Files (*.txt)|*.txt",False,"Open a text file")If UBound(files)>=0 Then WScript.Echo files(0)Else Wscript.QuitEnd If 'Opens multiple filesSet toolkit = CreateObject("VbsEdit.Toolkit")files=toolkit.OpenFileDialog("c:/scripts/","Text Files (*.txt)|*.txt",True,"Open a text file")If UBound(files)>=0 Then For Each filepath In files  WScript.Echo filepath NextElse Wscript.QuitEnd If

上面的代碼就是打開只可以輸入一個文件的對話框,第二段就是可以選擇多個文件的對話框

SaveFileDialog method

Prompt the user to save a file
toolkit.SaveFileDialog ([initialFolder,[initialFilename,[filters,[title]]]])

Set toolkit = CreateObject("VbsEdit.Toolkit")filepath = toolkit.SaveFileDialog("c:/scripts","test.txt","Text Files (*.txt)|*.txt") If Not(IsNull(filepath)) Then Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.CreateTextFile(filepath,True) objFile.WriteLine Date objFile.CloseElse Wscript.QuitEnd If

上面的代碼就是另存為 文本文件對話框

SelectFolder method

Prompt the user to select a folder
toolkit.SelectFolder ([initialDir,[title]])

Set toolkit = CreateObject("VbsEdit.Toolkit")myfolder=toolkit.SelectFolder("c:/scripts/","Please select a folder") If Not(IsNull(myfolder)) Then WScript.Echo myfolderElse Wscript.QuitEnd If

上面的就是瀏覽文件夾對話框

ENUMERATING WINDOWS

TopLevelWindows method
Enumerates top level windows

Set toolkit = CreateObject("VbsEdit.Toolkit")For each window in toolkit.TopLevelWindows() WScript.Echo window.WindowTitle WScript.Echo window.ProcessIdNext

枚舉頂級窗口

Window object

ClassName
Retrieves the name of the class to which the specified window belongs.

WindowTitle
Retrieves the title of the specified window's title bar or the text of the control if the specified window is a control.

DlgCtrlID
Retrieves the identifier of the specified control.

Height
Retrieves the height of the specified window.

Width
Retrieves the width of the specified window.

X
Retrieves the X coordinate of the upper-left corner of the specified window.

Y
Retrieves the Y coordinate of the upper-left corner of the specified window.

IsVisible
Determines the visibility state of the specified window.

ProcessId
Retrieves the identifier of the process that created the specified window.

Click method
Sends a mouse click event to the specified window.
window.Click ([offsetX ,[offsetY]])
If offsetX and offsetY are not specified, the event is sent into the middle of the window.

SendText method
Sends text to the specified window.
window.SendText text

ChildWindows method
Enumerates the child windows that belong to the specified parent window.

–EOF (The Ultimate Computing & Technology Blog) —


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 同心县| 家居| 天长市| 都江堰市| 高邑县| 卢龙县| 康定县| 静安区| 连州市| 壤塘县| 米脂县| 叶城县| 禄劝| 宁陵县| 义马市| 黑山县| 阿巴嘎旗| 尼木县| 新安县| 竹北市| 沐川县| 怀柔区| 高安市| 武胜县| 邛崃市| 舟山市| 凤庆县| 前郭尔| 铁力市| 阿尔山市| 吉木乃县| 运城市| 尚志市| 工布江达县| 新沂市| 大渡口区| 冷水江市| 辽阳市| 丰原市| 黄平县| 丁青县|