I noticed by SetForegroundWindow(), the caret of the target window would gain keyboard focus, and then I could use GetTUIThreadInfo() to find the hWnd of the caret in the target window. The trick is to give time (maybe using Sleep()) for the caret to gain keyboard focus.
What I would like to know is whether there is a way to find the caret of the target window without setting target window foreground. I am building a malware. I just want to send text from my little Foxpro tool to other windows. :) On Tue, Mar 13, 2012 at 11:53 PM, Dave Crozier <[email protected]> wrote: > That is by design and you need to have focus on the target window first using > an API call. > Setting to foreground window doesn't actually set focus, it simply puts the > window to the top of the Z order. -- .~. Might, Courage, Vision. SINCERITY! / v \ 64-bit Ubuntu 9.10 (Linux kernel 2.6.39.3) /( _ )\ http://sites.google.com/site/changmw ^ ^ May the Force and farces be with you! _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/CAGv=mjaod8rmnqvdjvngzgf3syvybnngph+ou15fwn-+gvt...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

