I'm trying to simulate keyboard events to a Java Application running on Firefox, checking with Spy++ I could see that the keyboard events were been sent to the handler ID X, I check it using Spy++ too and it returned that it was a "window" called "SunAwtFrame", but I can't get this window handler dinamically at all, I tried a lot of things, like FindWindow(), checking the process modules, etc.
Someone knows if is possible to get that?
Here is the firefox window, with the Java running inside it:
And the last coded I tried was:
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
IntPtr hWnd = (IntPtr)FindWindow("SunAwtFrame", "TibiaME - Web Client - XHTML - Mozilla Firefox");
It returns 0, if I remove the first parameter, it gets the Firefox handler.