sending text to cursor positon

hey,

i’m new to xojo and to basic in general, what I am after is a simple app that when someone clicks a button text is inserted to whatever
my cursor happens to be in at the time, for example if notepad is open i click a button and the text “this is a test!!” is inserted at that
blinking cursor position…

i cannot find a way to do it via clipboard but was thinking more like sendkeys?

any help is appreciated…

-thanks.

[quote=105532:@antoni christian]i’m new to xojo and to basic in general, what I am after is a simple app that when someone clicks a button text is inserted to whatever
my cursor happens to be in at the time, for example if notepad is open i click a button and the text “this is a test!!” is inserted at that
blinking cursor position…

i cannot find a way to do it via clipboard but was thinking more like sendkeys?[/quote]

See https://forum.xojo.com/6009-sendkey-function

thanks michel I have read that post but that seems to want to run notepad etc… i was using notepad as an example but I want ANY app that can accept plain text… i’m not sure can that code be adapted for that?..

This code works for any active Windows application. You cannot simply send to all applications, so you have to know the title of the application window you want to send to.

It works perfectly and I have used successfully in many occasions, but if I may, would it not be simpler for your app to place the text in question on the clipboard and all you got to do is press Ctrl-V when you need to insert the text ?