c# - Insert text at cursor position -


i need insert text variable @ cursor position no matter in window/program located, whenever c# or vba (preferably c#) code run write text variable.

pd: im using voicebot create custom scripts, c# default script looks this:

using system; using system.drawing;  public static class voicebotscript { public static void run(intptr windowhandle) {     var mytext = "this simple text";     //how add text variable cursor position?  } } 

to clarify: voicebot can run c# or visual basic scripts on voice commands, after writing script triggered voice. https://www.voicebot.net/ need run script example when playing game , chat selected, warn player x.

you can use sendkeys simulate keyboard , send keystrokes active application. example:

sendkeys.send("+this simple text"); 

note simulating keyboard, need explicitly invoke shift key (with + character, in example) uppercase character. there other caveats including other characters have escape, not feed method user-provided string without processing first. more information, see the documentation.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -