Mike M
2007-08-08 19:46:04 UTC
Hello,
I'm a novice Win32 GUI programmer, so please forgive if my question is too
silly.
A vendor my company works with, provides a "server" component which is
nothing more then their GUI application in server mode. The majority of the
time processes is pounding my sql server db with nonsense log messages.
Unfortunately, my configuration options are limited. Either I log the
diagnostics to the db and/or the GUI edit control. The edit control only
keeps a short history before the contents scroll away and are gone for good
however by enabling the db persistence at least we have a record of the
errors. Even more disappointing is that the level of log is very
weak...basically all records are written to the db and the edit control or
just to the edit control.
Why bore you with this? Basically the idea floating around is if we disable
the db persistence can we "hook" into the edit control, capture the text in
the control then dump the contents to a log file. Hooking into the edit
control is where I'm having some trouble.
Conceptually, I think I can use FindWindow to retrieve a handle to the
control. The I believe I needed to use SetProp to inject my callback handle
into the controls message loop? If that is successful, then I should receive
each windows message. How do I extract the text contents? I've been logging
the activity in the window using Spy++ however I never see any EM_* messages.
All I see are WM_PAINT, WM_ERASEBKGND, WM_SETREDRAW messages. I don't
understand where to find the data buffer in these messages?
Any help would be appreciated...
Cheers,
Mike
I'm a novice Win32 GUI programmer, so please forgive if my question is too
silly.
A vendor my company works with, provides a "server" component which is
nothing more then their GUI application in server mode. The majority of the
time processes is pounding my sql server db with nonsense log messages.
Unfortunately, my configuration options are limited. Either I log the
diagnostics to the db and/or the GUI edit control. The edit control only
keeps a short history before the contents scroll away and are gone for good
however by enabling the db persistence at least we have a record of the
errors. Even more disappointing is that the level of log is very
weak...basically all records are written to the db and the edit control or
just to the edit control.
Why bore you with this? Basically the idea floating around is if we disable
the db persistence can we "hook" into the edit control, capture the text in
the control then dump the contents to a log file. Hooking into the edit
control is where I'm having some trouble.
Conceptually, I think I can use FindWindow to retrieve a handle to the
control. The I believe I needed to use SetProp to inject my callback handle
into the controls message loop? If that is successful, then I should receive
each windows message. How do I extract the text contents? I've been logging
the activity in the window using Spy++ however I never see any EM_* messages.
All I see are WM_PAINT, WM_ERASEBKGND, WM_SETREDRAW messages. I don't
understand where to find the data buffer in these messages?
Any help would be appreciated...
Cheers,
Mike