Windows Develop Bookmark and Share   
 index > Windows Forms General > textbox hooks?
 

textbox hooks?

Hello,

In short: I need to write an application that watches another processes textbox for any changes.

I used one method that used a timer to cross-check the text I copied and the text it the box - but it was really inefficient and resource consuming.

How would I go about writing this? Would I need to write a hook or intercept it's window messages? Can anyone point me in the right direction? Thank you!

Deodorant

deodorant2  Tuesday, May 08, 2007 3:27 PM
Hi Deo,

Have a look at this thread. I think the question is similar to yours.

Regards,
Wole
Wole Ogunremi  Tuesday, May 08, 2007 8:21 PM
In an unmanaged app, you would use SetWindowsHookEx with WH_CALLWNDPROC to monitor the messages sent to the control. That will however not work in a .NET app, you can't inject the CLR in the process space of another application. Writing a C++ DLL is your only solution afaik.
nobugz  Thursday, May 10, 2007 4:22 PM

Use the _TextChanged event of the textbox

Adamus

Adamus Turner  Tuesday, May 08, 2007 3:28 PM
Even if the textbox belongs to another application?
deodorant2  Tuesday, May 08, 2007 6:13 PM
Hi Deo,

Have a look at this thread. I think the question is similar to yours.

Regards,
Wole
Wole Ogunremi  Tuesday, May 08, 2007 8:21 PM

Thanks for the reply, Wole.

That only explained to about getting the text from an edit control on another process (which is what I am doing), but that's only half the battle.

I need a way to notfity my application when the edit control has changed so I'm able to read the last line quickly. I tried using a timer to compare the old text with the new text, but I found out it would miss reading lines if they changed to fast.

deodorant2  Thursday, May 10, 2007 3:18 PM
In an unmanaged app, you would use SetWindowsHookEx with WH_CALLWNDPROC to monitor the messages sent to the control. That will however not work in a .NET app, you can't inject the CLR in the process space of another application. Writing a C++ DLL is your only solution afaik.
nobugz  Thursday, May 10, 2007 4:22 PM

You can use google to search for other answers

Custom Search

More Threads

• open an application from a windows service
• SelectedIndexChanged in C# WinFrms databind listbox
• Rolling logs with log4net?
• control.getnextcontrol not give me reference to a control from a control in a usercontrol
• incorrect synatx near keyword where
• why 'q' cann't input
• I don't understand Control.Dispose()
• c#.NET Listbox
• Change Image Color
• numericupdown detect down arrrow button for negative direction