I would like to know if there was any way to lock onto a Flash window and post a message to it? Another person here had the answer to it, his name is Spencer K. His question was: Sending simulated click via WebBrowser in C# to flash object embedded in HTML
Unfortunately, Mr. K wasn't very specific, and all he left behind for people reading his question was that he "got the handle and then iterated through the handles." I'm not extremely sure what he meant by that. I iterated through all visible handles using EnumWindows to no avail, as that did not return a window that was a flash window.
I hope somebody here could tell me, as it's been driving me mad for the past few days.
EDIT: I've just settled on inserting an SWF Object into my form and posting messages to the handle of that.
Actually flash window has its own handle too. To get it you have to get the class names of the controls it is embedded in from Spy++, then you can reach it like this:
When you get the handle, you can post the clicks:
The points will be relative to the client, so when you save them, you should save it like this:
Hope this was helpful
You can do it via javascript.
Import this:
Ad this to your AS code:
On your JS object of the flash object you can call this function:
This is the function to get the js object of the flash object:
I did not test this code, I just copied it out of a project.
edit: added js function to get js object
The Flash window will probably not have its own handle, since it is embedded in a webpage. You would want to post the message to the web browser window (that's what Mr. K did).
If that doesn't work for you, the only other option that I'm aware of is to gain control of the browser via WebDriver or WatiN and interact with the flash object using javascript.
for calling a function in flash object u can use this code
for more information follow this link:communicate-betwen-c-and-an-embeded-flash-application
i try it for a flash object in my form application and it work,but i did not use it for webbrowser