Read another applications textboxes (VB 2005)

P

Paul

Hi everyone,
I have created my first real life application, that runs in the system tray
and monitors changes to the clipboard, then depending on the content it may
search our stock file and display the current stock situation in a balloon
(using balloontiptext).

I now want to add extra functionality to my program by making it read text
from any other application without the user having to copy text to the
clipboard.

I have a timer that runs every couple of seconds and I have managed to get
the windows title from any program that is currently running, into a
variable in my application, but I can't figure out how to read other fields
on the users application (ideally which ever has the focus)

Ideally I want to copy the entire content of an email body into a vairable
in my application, so I can then search it for product codes, and then if
necessary provide stock info in a bubble.

Can anyone help ?, sample code much appreciated as I am new to VB.net and I
have previously only worked with MSAccess VBA.

Thanks

Paul
 
B

Blarneystone

The down and dirty way I'd try to do it would be by simulating a mouse
click in the text box, then sending a "ctrl-A" for select all, then
"ctrl-c" for copy - your app should take care of the rest. I would
image this would be disruptive to an end user though.

Brad
 
P

Paul

Thanks Brad,
I've just tried this, but its unusable, and I cant find a command to
de-select all, so I used the END key.

This would also prevent the user from being to use the clipboard for what
they want it for.

Any other suggestions much appreciated.

Paul
 
P

Paul

I have read this but I still can't manage to get it to work (Mainly because
I'm a beginner who's bitten off more than I can chew !)

Any chance anyone out there can supply a .NET example of how to take the
text from a notepad txt file when it has focus and put it in a vairable in
my app, I should be able to convert that to work with my app then.

Again a big Thanks to all.

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top