Keyboard + SendInput + erratic results + opens Menus
Posted on 2009-05-04
I am trying to build a word expansion application in visual basic 6.
(eg "atis" will be replaced with "and there is" )
I am trying to use Sendkeys / SendInput to input keystrokes to an application (eg. Word, Wordpad etc), namely CTL, SHIFT, LEFT ARROW, RIGHT ARROW
in order to select the word the Caret is in (ie. atis), and then do a word replace ie, "atis" becomes "and there is".
The problem is that the Sendinput code (CTL, SHIFT, LEFT, RIGHT etc) causes erratic jumps of the caret, and will often open a menu.
I guess that I need to block user input (efg BlockInput API) during the routine,
but this doesnt seem to work properly
Any Ideas Anybody