sendmessage mouseevent not working

Posted by kevin on Stack Overflow See other posts from Stack Overflow or by kevin
Published on 2009-07-27T05:11:22Z Indexed on 2010/12/23 12:54 UTC
Read the original article Hit count: 263

Filed under:

I have this code:

Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4

Dim WindowHandle As Long = FindWindow(vbNullString, "Ultima Online")

SendMessage(WindowHandle, MOUSEEVENTF_LEFTDOWN, 0, 0)
SendMessage(WindowHandle, MOUSEEVENTF_LEFTUP, 0, 0)

I know it is getting the windowhandle fine, because I made a conditional statment that pops up a messagebox if windowhandle = 0

The problem is that it is not sending the mouse click to the window.

© Stack Overflow or respective owner

Related posts about vb