Friday, 15 April 2011

c++ - Simulate mouse click in background window -



c++ - Simulate mouse click in background window -

i'm trying utilize sendmessage post mouse clicks background window (chrome), works fine, brings window front end after every click. there way avoid that?

before says duplicate question, please create sure other topic mentions not activating target window, because couldn't find any.

update: aha, hiding window trick, almost. receives simulated mouse/keyboard events intended, , doesn't show on screen. however, can barely utilize own mouse navigate around computer, , keyboard input disrupted.

so question is, how sending messages window impact other applications? since i'm not simulating mouse/keyboard events, shouldn't other windows oblivious this? perchance related window calling setcapture when receives wm_lbuttondown? , how avoid that, other hooking api phone call (which very, ugly such little task)?

the default handling provided scheme (via defwindowproc) causes windows come front end (when clicked on) response wm_mouseactivate message, not wm_lbuttondown.

the fact chrome comes front end in response wm_lbuttondown suggests it's chrome doing, rather default scheme behaviour might able prevent in way.

the source code chrome available; suggest have @ , see if indeed chrome doing itself. if so, practical way able prevent (short of compiling own version of chrome) inject code chrome's process , sub-class main window procedure.

c++ winapi input

No comments:

Post a Comment