开发者

Emulate mouse events with PostMessage without gaining focus (WINAPI)

I emulated the mouse events using PostMessage and tested on the notepad application. I don't want to gain focus of the notepad application by sending mouse events.

The events are received only if I use the ChildWindow of the notepad (ie the white space where you can write) in PostMessage paramet开发者_运维知识库ers, that means I can't click on the menu of the app (File, Edit ..). Do you have any idea on how to do that without setting the focus?


If you want to use the menu items of a window menu, figure out the menu command ID's and then send them to the main window via the WM_COMMAND message. Use Spy++ to help with the menu command ID's.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜