SendKeys
Previous  Top  Next

Prototype

SendKeys (strWindowCaption, strKeys, boolShift, boolAlt, boolCtrl, boolVirtual, boolFore)

Description

It sends a keys sequence to a window.

Parameters

StrWindowCaption: string representing the name of the window where a keys sequence can be sent.

StrKeys
: string corresponding to the text or the object to send.

BoolShift
: logical value true or false. If true is set there will be the StrKeys value and the key Shift.

BoolCtrl
: logical value true or false. If true is set there will be the StrKeys value and the key Ctrl.

BoolAlt:
logical value true or false. If true is set there will be the StrKeys value and the key Alt.

BoolVirtual
: logical value true or false. If true is set, it shows that a key is sent and not a letter.

BoolFore
: logical value true or false. If true is set, the window is left in front or else it returns on the first window.

Returned value

None.

Notes

In order to send a key (BoolVirtual=true) it needs to pass as parameter StrKeys one of the following strings, in accordance with the key to be sent. For each command it can be sent just a key.

VK_TAB
VK_BACK
VK_RETURN
VK_CLEAR
VK_MENU
VK_PAUSE
VK_CAPITAL
VK_ESCAPE
VK_END
VK_HOME
VK_NEXT
VK_PRIOR
VK_LEFT
VK_RIGHT
VK_UP
VK_DOWN
VK_PRINT
VK_SNAPSHOT
VK_INSERT
VK_DELETE
VK_HELP
VK_F1
VK_F2
VK_F3
VK_F4
VK_F5
VK_F6
VK_F7
VK_F8
VK_F9
VK_F10
VK_F11
VK_F12
VK_NUMLOCK

It is not possible to send more than a key for each command.

Example

// It stores a table handle
UnaTabella:=TableOpen('c:\archive\index\','clients.db');

// It places itself on the first record of the table 
TableFirst(UnaTabella);

// It starts the cycle
While not TableEOF(UnaTabella) do

Begin  
 
// It sets the edit mode   
TableEdit(UnaTabella);  
 
// It sends a keys sequence  
SendKeys('Invoices', TableGetFieldByName(UnaTabella,'COMPANY TITLE'), False, False, false);  
 
// It moves on the next record  
TableNext(UnaTabella);  
End;  

// It closes the table
TableClose(UnaTabella);