Heres my code that does not work:
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim wHandle As Long = FindWindow(vbNullString, "Ultima Online")
PostMessage(wHandle, MOUSEEVENTF_LEFTDOWN, 0, 0)
PostMessage(wHandle, MOUSEEVENTF_LEFTUP, 0, 0)