没有合适的资源?快使用搜索试试~ 我知道了~
首页WSH and VBScript - Advanced Windows Script Host Developers Guide (2003)
WSH and VBScript - Advanced Windows Script Host Developers Guide...
需积分: 9 18 下载量 20 浏览量
更新于2023-03-03
评论
收藏 2.48MB PDF 举报
WSH and VBScript - Advanced Windows Script Host Developers Guide (2003) ,非常有价值的资料
资源详情
资源评论
资源推荐
© G. Born – Advanced Windows Script Host Developer's Guide
Günter Born
Advanced
Windows Script Host
Developer's Guide
II
© G. Born – Advanced Windows Script Host Developer's Guide
Günter Born
Advanced Windows Script Host Developer's Guide
This is the English version of parts of my book:
"Inside Windows Scripting Host",
Microsoft Press Germany, 2002
ISBN 3-86063-495-X
Published by Günter Born
Copyright © 2003 by Günter Born
www.borncity.com
All rights reserved. No part of the contents of this document may be reproduced or transmitted in
any form or by any means without the written permission of the author/publisher.
Disclaimer
The materials, sample code, and files in this text and from referenced sources are provided AS IS
WITHOUT WARRANTY OF ANY KIND AND ARE PROVIDED WITHOUT ANY IMPLIED
WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY. Use of the materials
and code is to be undertaken entirely at your risk, and the results that may be obtained from that
use are dependent on the user.
III
© G. Born – Advanced Windows Script Host Developer's Guide
G. Born:
Advanced Windows Script Host Developer's Guide
Introduction XXIII
The story about this book?.....................................................................................................XXIII
How to use this book?........................................................................................................... XXIV
A few other remarks ...............................................................................................................XXV
1
Tools and Techniques 15
A few tips to edit scripts ............................................................................................................. 15
How to create a script? 15
Edit existing script files? 18
Define your own Edit script command 18
Script Editors .............................................................................................................................. 20
EditPlus 20
PrimalSCRIPT script editor 21
Using Microsoft Script Editor 21
Other editors 25
The OLE/COM Object Viewer................................................................................................... 26
Using the Object Browser........................................................................................................... 27
Debugging WSH scripts ............................................................................................................. 31
Using a WSH IDE to execute and debug scripts 31
2
User Input in scripts 33
User input in VBScript ............................................................................................................... 33
User input in JScript ................................................................................................................... 36
JScript-user input using a second script 36
Internet Explorer for JScript user input....................................................................................... 39
Implementing an InputBox function in HTML 40
Call the function within the HTML document 41
The InputBox implementation for JScript 42
An InputBox ActiveX control..................................................................................................... 48
3
Using forms 51
User Forms with Internet Explorer ............................................................................................. 51
Creating a Dialog using showModalDialog 51
Using Internet Explorer for dialogs 56
Creating Forms using Internet Explorer...................................................................................... 59
The HTML code for the form 59
IV
© G. Born – Advanced Windows Script Host Developer's Guide
DHTML code to control your form 61
A WSH script to use the form 65
A JScript WSH script to access the form 70
Form input using a CallBack function........................................................................................ 72
Using ActiveX controls as forms................................................................................................ 75
Using an ActiveX control for an about dialog box 76
Using the About dialog from a WSH script 82
Using a form for user input......................................................................................................... 84
Creating the form using VB 5 CCE 84
How to define global variables to keep user input values? 89
How to implement the form handling methods? 89
How to use the ActiveX control in a WSH script? 91
Using the form in JScript 92
Implementing a password input dialog ....................................................................................... 93
A WSH script using the password input 95
4
ActiveX controls programming 99
VB 5 CCE the basics .................................................................................................................. 99
What is VB 5 CCE? 99
Create a new ActiveX-Project 101
Introduction into VB 5 CCE ..................................................................................................... 102
About projects, classes, modules and properties 102
The code window 105
The properties window 107
Inserting controls into a Form 109
Creating an OCX file................................................................................................................ 110
Create an install file for an ActiveX control 113
How to get information about objects?..................................................................................... 114
Create an object description for the object browser 115
A project sample ....................................................................................................................... 116
ActiveX samples....................................................................................................................... 119
Implementing the WSHKeyExist1 method................................................................................ 119
A Wait method for Scripts 123
A method to play sounds within a script 129
WSHShell- and WSHAppActivate methods............................................................................... 134
Implementing the WSHShell method 135
Implementing the WSHAppActivate method 137
Testing WSHShell and WSHAppActivate 139
The SendKeys problem ............................................................................................................. 140
V
© G. Born – Advanced Windows Script Host Developer's Guide
Implementing a WSHSendKeys method.................................................................................... 143
Remarks about the WSHSendKeys method 143
Remarks about the WSHSendKeys implementation 146
Sample 1: Launch and terminate Calc.exe 147
Sample 2: Manipulating two applications using WSHSendKeys 150
Sample 3: Clipboard handling using WSHSendKeys 153
Using WSHSendKeys to create a new user account .................................................................. 157
How to handle windows?.......................................................................................................... 165
The WSHFindWindow method 166
The WSHIsWindow method 167
The WSHIsIconic method 168
The WSHShowWindow method 170
The WSHSetForegroundWindow method 173
The WSHMoveWindow method 174
The WSHFlashWindow method 175
Sample 1: Manipulate a window 177
Sample 2: A moving and flashing window 179
Shutdown Windows 95/98 using a script.................................................................................. 183
A script using the WSHExitWindows method 185
5
WSH and Microsoft Office 189
Using Microsoft Excel.............................................................................................................. 189
The Excel object model 189
A sample to access Excel 190
Set the window properties 191
The implementation in VBScript 193
An implementation in JScript 194
Create an Excel worksheet and add the content 196
The VBScript implementation 199
The JScript Implementation 202
Writing WSH information into a worksheet 204
The VBScript Implementation 206
The JScript implementation 209
Load an Excel XLS file and read the data 212
Implementing the sample in VBScript 214
An implementation in JScript 215
Importing a CSV file in Excel 217
How to import CSV files into several columns? 220
Using Microsoft Word.............................................................................................................. 226
剩余431页未读,继续阅读
afeu007
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 2023年中国辣条食品行业创新及消费需求洞察报告.pptx
- 2023年半导体行业20强品牌.pptx
- 2023年全球电力行业评论.pptx
- 2023年全球网络安全现状-劳动力资源和网络运营的全球发展新态势.pptx
- 毕业设计-基于单片机的液体密度检测系统设计.doc
- 家用清扫机器人设计.doc
- 基于VB+数据库SQL的教师信息管理系统设计与实现 计算机专业设计范文模板参考资料.pdf
- 官塘驿林场林防火(资源监管)“空天地人”四位一体监测系统方案.doc
- 基于专利语义表征的技术预见方法及其应用.docx
- 浅谈电子商务的现状及发展趋势学习总结.doc
- 基于单片机的智能仓库温湿度控制系统 (2).pdf
- 基于SSM框架知识产权管理系统 (2).pdf
- 9年终工作总结新年计划PPT模板.pptx
- Hytera海能达CH04L01 说明书.pdf
- 数据中心运维操作标准及流程.pdf
- 报告模板 -成本分析与报告培训之三.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0