Basicly im trying to determine when a new line has been appended to the
textbox of another application. Using spy++ I see that the msg (wm_user
+ 97) is being sent, which is the EM_SETTEXTEX msg(combination of
wm_settext and em_replacesel).
Below are a few lines of code of what im trying to accomplish:
private const uint WM_USER = 0x0400;
EM_SETTEXTEX = (WM_USER + 97) // Comes from an enum I have. (hooktype)
I have gotten the ThreadID of the RichTextbox in the other app I want
to catch appended text on, and then am calling a SetWindowsHookE x msg:
// setting the hook on the richedit20a window
// _hookType = EM_SETTEXTEX, when converted to uint is 1119
_hHook = SetWindowsHookE x(_hookType,_fi lterFunc,IntPtr .Zero,threadID) ;
When doing this though I am getting no instance of an IntPtr back
letting me know the hook is successfull. I can only conclude that the
hookType uint code is not right or its not injecting correctly into the
thread. I have tested that the rest of my code is correct by doing a
SetWindowsHookE x for the hook type of WH_CBT on my
AppDomain.GetCu rrentThreadID() and I can see an instance of the hook
being returned.
textbox of another application. Using spy++ I see that the msg (wm_user
+ 97) is being sent, which is the EM_SETTEXTEX msg(combination of
wm_settext and em_replacesel).
Below are a few lines of code of what im trying to accomplish:
private const uint WM_USER = 0x0400;
EM_SETTEXTEX = (WM_USER + 97) // Comes from an enum I have. (hooktype)
I have gotten the ThreadID of the RichTextbox in the other app I want
to catch appended text on, and then am calling a SetWindowsHookE x msg:
// setting the hook on the richedit20a window
// _hookType = EM_SETTEXTEX, when converted to uint is 1119
_hHook = SetWindowsHookE x(_hookType,_fi lterFunc,IntPtr .Zero,threadID) ;
When doing this though I am getting no instance of an IntPtr back
letting me know the hook is successfull. I can only conclude that the
hookType uint code is not right or its not injecting correctly into the
thread. I have tested that the rest of my code is correct by doing a
SetWindowsHookE x for the hook type of WH_CBT on my
AppDomain.GetCu rrentThreadID() and I can see an instance of the hook
being returned.
Comment