Hi.
I'm trying to trap WM_SETTEXT messages using system hooks and all
seems to be going well with the hooking process (i.e. I get the
messages and they correspond to the same messages I see in Spy++,) but
for the life of me I cant figure out how to get at the string: "lParam
- Pointer to a null-terminated string that is the window text." All
attempts to strlen(lParam) or strcpy(lParam) just cause havoc.
I regularly work with the .NET framework, but most of my C/C++
experience is very rusty and was very unix-centric to begin with. I'm
assuming that I'm missing something here, like having to marshal the
string across processes (the messages are being snatched from another
process) or having to envelope the whole copying affair in a critical
section or perhaps even just using different APIs than the good ol'
stdio.h stuff.
Can anyone shed any light on this for me? It seems like "getting the
text" from a message should be a fairly straightforward task.
Thanks,
Ian