Please enable JavaScript to view this site.

thinBasic Help Manual

* * HELP & MANUAL PREMIUM PACK 4 DEMO VERSION * *

This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.

This version is copyright and may only be used for local testing purposes. It may not be distributed.

Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.

 

Description

 

Send text to the current top-level window simulating keyboard keystrokes.

 

Syntax

 

hWnd = Sendkeys(TextToSend [, mSec])

 

Returns

 

Number: handle to the window if found

 

Parameters

 

Name

Type

Optional

Meaning

TextToSend

String

No

Text to send

mSec

Number

Yes

Milliseconds to wait after text has been sent.

 

Remarks

 

SendKeys function uses keybd_event API function. keybd_event API has been superseded by SendInput API. For this reason SendString function has been developed.

 

Sendkeys function should emulate most of the same rules as the Visual Basic Sendkeys.

 

You can send these codes:

{ENTER}

{ESC}

{UP}

{DOWN}

{LEFT}

{RIGHT}

{BACKSPACE} or {BS}

{HOME}

{END}

{PGUP}

{PGDN}

{TAB}

{DEL} or {DELETE}

{INS} or {INSERT}

{WIN}

{PRTSC}

(CAPSLOCK}

{NUMLOCK}

{SCROLLLOCK}

{HELP}

{F1} to {F16}

{SLEEP 1000} <-- 1000 miliseconds

{AppActivate WindowName}   <-- switches to this window

 

Precede characters with + for Shift, ^ for Ctrl, % for Alt

 example: ^p       would be Ctrl-p

 

You can also group characters for shift/ctrl/alt with parentheses ()

 example: ^%({DEL}{DEL})  would be Ctrl-Alt-Del twice

 

To send these special characters {+^%~( as plain characters enclose them in braces

 example: {{}      would just send  {

 

To send a key multiple times inclose it in braces with a number like {h 3}

 example: {DEL 41)  would send DELETE key 41 times

 

Restrictions

 

See also

 

 SendString

 

Examples

 

Sendkeys("This is my text to send.{ENTER}")

 

Created with Help+Manual 8 and styled with Premium Pack Version 4 © by EC Software