I have a program running on my PC that controls another machine via TeamViewer. It all works fine except that sending a mouse click requires TeamViewer to be in the foreground. I have code that sends mouse clicks to programs like Notepad where the edit panel is called "Edit." But the TeamViewer panel is called TV_REMOTEDESKTOP_CLASS and FindWindowEx fails to find its handle.
Here is my code:
IntPtr handle = WinGetHandle("axie_machine");
if (handle != IntPtr.Zero)
{
var panel = FindWindowEx(handle, IntPtr.Zero, "TV_REMOTEDESKTOP_CLASS", null);
PerformRightClick(panel, new Point(200, 200));
}
Here is the image of Spy++ showing the details of the panel
FindWindowEx returns 0x000000.
Can anyone see what I am doing wrong with FindWindowEx and point in the right direction?