java - How can i send click mouse and keyboard events to a flash plugin running in firefox when the firefox window runs in background with JNA? -


i want program bot in java controls flash program running in firefox. therefore have send mouse , keyboard events it. on research found jna , used creating screenshot of firefox window(it works of course when firefox in background, have handle of firefox window). after started easy mouse events simple left click(see code below), doesn't work. tested own simple window , events sent processed jframe's mouselistener , not example jbutton's actionlistener.

user32 user32 = (user32) native.loadlibrary("user32", user32.class,             w32apioptions.default_options);      getrightwindowhandle(user32);      system.out.println("got right handle");      windef.hwnd hwnd = rightwindowhandle;     thread.sleep(1000);      long y = 20 + (20 << 16);// x + (y << 16)     windef.lparam l = new windef.lparam(y);     windef.wparam w = new windef.wparam(0);     user32.postmessage(hwnd, wm_lbuttondown, w, l);     system.out.println("message posted");     thread.sleep(1000);     user32.postmessage(hwnd, wm_lbuttonup, w, l); 

unluckily absolute beginner jna have no idea how can make events processed components on window , not window itself. can provide me short code snippet this? happy links or keywords can search me understanding , removing error.

it's possible mistake somewhere else me looks mistake.

ok solved problem now: instead of window handle of firefox window used window handle of plash player in firefox. got spy++ , enumchildwindows() function.


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -