This may sound overkill, as I saw SLaks's answer..
You would need
- The handle of the Window using
Handle
property
- Use pinvoke on the
SendMessage
Win32API
- One of the parameters to
SendMessage
is WM_LBUTTONDOWN
Here's a declaration for the SendMessage
[DllImport("user32")] static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
Here's the constants used:
public const int WM_LBUTTONDOWN = 0x201;
public const int WM_LBUTTONUP = 0x202;
Typical Invocation:
SendMessage(someWindow.Handle, WM_LBUTTONDOWN, IntPtr.Zero, IntPtr.Zero);
SendMessage(someWindow.Handle, WM_LBUTTONUP, IntPtr.Zero, IntPtr.Zero);
The invocation is an example of how to send a mouse left-click to a specified window.
I used pinvoke.net to obtain the correct API.
Hope this helps,
Best regards,
Tom.