| Back to logs list
135135 2010 年 11 月 08 日 17:41 Reading (loading. ..) Comments (0) Category: Personal Diary
SendKeys statement
one or more key messages will be sent to the active window, just as the same with the keyboard for input.
SendKeys string [,
coach outlet, wait]
parameter meaning:
string part of the necessary string expression that specifies the key messages to be sent.
Wait optional way to specify the value of waiting. If False (the default), then control is sent immediately after the keys back to the process; If True, then the control key messages must be addressed before the return to the process. Description of each key, said one or more characters.
1) To specify a single keyboard character,
09.04.21 NTFS DBR - Qzone log, the character itself must be the key. Example, to represent the letter A, you can use the In order to express more than one character, we must add another character directly behind the character. For example, to express A, B and C, can be
2) of the SendKeys, the plus sign +, the caret ^, percent%,
coach wallet, on the dash ~ and parentheses () are of special significance. To specify any of these characters, to put it among the braces {}. For example, to specify the positive number, {+} that can be used. To specify brace characters, use {{} and {}}. Square brackets [] is not on special significance SendKeys, but you must put them in braces. In other applications, the square brackets have special significance, in the event of Dynamic Data Exchange (DDE) when it could be important.
3) when a key is pressed to specify the characters that do not show, such as ENTER or TAB, and those who said the key action rather than characters, use the following code:
key code
BACKSPACE {BACKSPACE}, {BS} or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
ENTER {ENTER} or ~
ESC {ESC}
NUM LOCK {NUMLOCK}
SCROLL LOCK {SCROLLLOCK}
UP ARROW {UP}
DOWN ARROW (down arrow) {DOWN}
LEFT ARROW {LEFT}
RIGHT ARROW {RIGHT}
END {END}
HOME {HOME}
INS or INSERT {INSERT} or {INS}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
WIN ^ {ESC}
TAB {TAB}
HELP {HELP}
F1 {F1}
F2 {F2}
F3 {F3 }
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
4) To specify those with SHIFT, CTRL and ALT key combinations and other key combination can be placed in front of these key codes of one or more code that are listed below:
key code
SHIFT +
CTRL ^
ALT%
5) To illustrate the other keys should be pressed at the same time Under the SHIFT, CTRL, ALT, and any combination of keys,
coach women shoes, those keys of the code on the brackets. For example, press the E and C to illustrate the time when pressing the SHIFT key, use the To illustrate, when you press the E key while pressing the SHIFT, but then by C rather than by SHIFT, use
6) To specify repeating keys, use the form {key number}. Key and the number must be placed between a space. For example, {LEFT 42} means press the LEFT ARROW key 42 times; {h 10} means 10 is pressing the H key. Note that keys can not use SendKeys to send a message to an application that the application has not been designed to run on Microsoft Windows.
Note: Sendkeys PRINT SCREEN key can not be sent to any application.
set WshShell = WScript.CreateObject (
SendKeys
analog keyboard, one or more key commands sent to the specified window to control Windows applications run,
the use of the format: object.SendKeys string
1. the basic keys
general, to send key commands can be directly used to represent the key character in itself, for example, to send the letter SendKeys Of course, several key commands can be sent directly, simply with the key characters in sequence can, for example,
coach shoes, to send key
2.
for the needs of special function keys and Shift,
coach bags, Ctrl,
coach sunglasses, Alt key combination of the three control keys, SendKeys using special characters to represent:
Shift --------- WshShell. SendKeys --- - WshShell. SendKeys
with braces as long as these characters can be. For example:
to send a plus sign need to use the large button in parentheses the name of,
http jr.ztgame.com html upload article 20071112 11, for example, to send the Enter key, you need to use the
Space --------- WshShell.SendKeys;
← --------- WshShell. SendKeys;
F1 ------- - WshShell.SendKeys described using the simplified format, use the format For example, to send 10 letters
Example:
--------------------- ------------- Press F5 to refresh the desktop ------------------
Dim WshShell, Path, i
Set WshShell = WScript.CreateObject (------------------------------------
automatically restart the computer;
set WshShell = CreateObject (br >------------------------------------- ----------- ----
Start Task Manager
set WshShell = CreateObject (
------------------ ------------------------- ---------
QQ message mass
Dim WshShell
Set WshShell = WScript.createObject (;
WshShell.AppActivate br> WshShell.SendKeys i
WshShell.SendKeys -------------------------- ---------
automatically to the Baidu search for song: white flag;
Dim WshShell, Path,
Yi Jiangnan Dreaming - Qzone log, i
Set WshShell = WScript.CreateObject (
WScript.Sleep 2000
WshShell.AppActivate WshShell.SendKeys --------------------------------------
entered in Notepad Happy Birthday! and save birth.txt
Dim WshShell
Set WshShell = WScript.CreateObject (;
WScript.Sleep 1500
WshShell.AppActivate;
WshShell.SendKeys br> WshShell. SendKeys SendKeys;
WScript.Sleep 500
WshShell.SendKeys br> WScript.Sleep 500
WshShell.SendKeys Sleep 500
WshShell.SendKeys;
WshShell.SendKeys> WshShell.SendKeys;
WScript.Sleep 500
WshShell.SendKeys;
----------------------------------- ----------- ------
production can automatically save the notebook regularly
'Part I: definition of variables and objects
Dim WshShell, AutoSaveTime, TXTFileName
AutoSaveTime = 300000
Set WshShell = WScript.CreateObject (Chinese and pure digital):
WshShell.AppActivate;
WScript.Sleep 300
WshShell.SendKeys TXTFileName
WScript.Sleep 300
WshShell.SendKeys Sleep AutoSaveTime
'Part IV: Automatic time save
While WshShell.AppActivate (TXTFileName) = True
WshShell.SendKeys br> WScript.Sleep AutoSaveTime
Wend
WScript.Quit
---------------------- ------------------------- -----
crash, hehe!
DIM WSHSHELL
SET WSHSHELL = WSCRIPT.CreateOBJECT (
WSHSHELL.SENDKEYS 1000
WSHSHELL.SENDKEYS. SLEEP 1000
WSHSHELL.SENDKEYS - -------------------------
time off the
Dim WshShell
Set WshShell = WScript.CreateObject (