Send keystroke to a controlTag(s): WinAPI/Registry


[Function declaration]
SUBROUTINE keybd_event( int bVk, int bScan, int dwFlags, int dwExtraInfo) &
  LIBRARY "user32.dll" 

[powerscript]
li_vkey = 65      // the character "A"
sle_1.setfocus()  // the target control
keybd_event( li_vkey, 1, 0, 0 ) 
The following will send a backspace to a SingleLineEdit, deleting the last character.
[powerscript]
integer li_vkey
integer ll_pos

ll_pos = len(sle_1.Text) + 1
sle_1.selectText(ll_pos,0)   // set the cursor at the end
li_vkey = asc("~b")          // backspace
keybd_event( li_vkey, 1, 0, 0 )

blog comments powered by Disqus