Hello, I fully emulate clicking LKM in the program, I repeat everything that is in spy ++, but the program does not respond to a click. The program is clean, there is nothing there, except for a couple of buttons for the test. Code:

PostMessage(handle, WM_MOUSEHOVER, (IntPtr)0, 0); SendMessage(handle, WM_SETCURSOR, handle, MakeLParam(18, WM_MOUSEMOVE)); SendMessage(handle, WM_SETCURSOR, handle, MakeLParam(1,WM_MOUSEMOVE)); SendMessage(handle, WM_MOUSEACTIVATE, handle, MakeLParam(1, WM_LBUTTONDOWN)); SendMessage(handle, WM_SETCURSOR, handle, MakeLParam(1, WM_LBUTTONDOWN)); PostMessage(handle, WM_LBUTTONDOWN, (IntPtr)0x0001, MakeLParam(x, y)); Thread.Sleep(5); PostMessage(handle, WM_LBUTTONUP, IntPtr.Zero, MakeLParam(x, y)); 

Spy ++ after the real click: enter image description here

Spy ++ after emulated click: enter image description here

  • I think on c ++ you will get the same thing. Use mouse_event cyberforum.ru/win-api/thread420159.html . - nick_n_a
  • Interception is not suitable, I am doing an automatic panel, on the server other work is still underway :( - kekman
  • one
    And why one through PostMessage, others - through Send. What is the logic of choice? If you need a particular order of messages, you must send everything in one way. The system puts the mouse messages in the queue, so probably everything is necessary through Post. - MSDN.WhiteKnight
  • I have already tried all the ways, if you look at the letters before SMS, you will understand why some through the post, others through the send. Replacing all with one type will not work - kekman

0