2

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 parameters, 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?

Daniel Daranas
  • 22,454
  • 9
  • 63
  • 116
Laetitia
  • 21
  • 1
  • possible duplicate of [Create an On-screen Keyboard](http://stackoverflow.com/questions/4944621/create-an-on-screen-keyboard) – tenfour Feb 21 '11 at 23:59
  • @tenfour: that question is related to this, but it's definitely not a duplicate. – MusiGenesis Feb 22 '11 at 00:05
  • hi, I would like to send events on some windows using a top layered transparent window so that I can draw on it and manage the windows list. I need to have always the focus on the top window to perform that but I would also like to interact normally with the windows... – Laetitia Feb 22 '11 at 10:08

1 Answers1

3

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.

Maurizio
  • 194
  • 1
  • 5