Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have hooking application that takes whatever data it shows on its edit box (XP system calculator). Hooking has gone well, except that I used thread to get the its edit box data. I am aware that there's a way to get it without using loops/thread but I just can't figure it out how. CALLBACKs???(I'm not sure) I tried using Window Messages like: WindowProc or PreTranslateMessage. But I can't Set or GetWindowText - I observed, maybe because, my components were manually created (hard coded), since when I use a dragged&dropped item, I can set/getWindowText (But I am contrained to use Hard Code). Anyway, all I just need to know from YOU is how to make that function/code that don't use common loops (for, while, etc) or threads. Please help.....thanks a lot.
Please provide sample code so that I'll grasp the concepts. Thanks.
Posted
Updated 25-Aug-10 21:15pm
v3
Comments
Eugen Podsypalnikov 26-Aug-10 4:53am    
I am not sure, there is a difference between "hooking" and "hacking" terms in you skills... :)
The hooking was provided to get some notifications (not to generate it) :)
See also: SetWindowsHookEx(..) description at MSDN.
this_is_my_alias 26-Aug-10 5:35am    
Its hooking. And Yes, the purpose is to get notifications/intercept messages on some process. I don't get "not to generate it". But it's possible that you do more than getting messages like you can pass your own message to that hooked application (sending & receiving between processes).....
Eugen Podsypalnikov 26-Aug-10 6:28am    
OK... Can you try to filter the calc's messages on WM_NOTIFY and analyze them in your hook procedure ? :)

1 solution

I have no idea what you're asking. Why not use a loop, if a look is what you need ? Do you mean you want to get the data from the textbox when it changes ? Can you subscribe to the text changed event for the textbox ? That's the only way to know when the text changed, otherwise, you need a loop or a timer or something to keep polling at random.
 
Share this answer
 
Comments
this_is_my_alias 26-Aug-10 3:39am    
I'm constrained not to use threads/loops.
I am doing a hooking. I actually can GET the data from that edit box using [SendMessage(...)] but I can't use SetWindowText on my application because WindowProc won't allow me, it cause stack overflow/access denial. It won't allow me because I think its manually created and not through drag & drop. Anyway, I know its hard to figure things out just through texts. Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900