Sending simulated click via WebBrowser in C# to flash object embedded in HTML

ぃ、小莉子 提交于 2020-01-01 05:43:07

问题


I have not been able to find a way to send a simulated click to a flash .SWF application on a site I'm visiting using the WebBrowser control in WinForms.

Though I've read countless posts on the subject, there seems to not be much information floating around on the internet. The only resources I've found here that technically provide answers for my question are:

Reading Packets - This link recommends reading the packets sent from the flash application and might be my only working solution.

Requiement: I do not wish to communicate directly with ActionScript to obtain my results. I just want it to blindly click the flash movie and wait for something to happen.

If it is not possible, I'd like feedback anyway. Thank you!


UPDATE: (3/23/2012 - 23/3/2012)

Since no feedback, I figured I'd post an update

I wound up just sniffing the packets sent by the .SWF, and then sent that same data via the webBrowserObject.Navigate method. Thanks anyway!


UPDATE: 3/31/2012 - 31/3/2012

Wound up bringing back to life my old debate of whether or not to use SendMessage or PostMessage to send an actual click to the window without hijacking the mouse. It seemed beneficial to have both the physical and imitated clicks as options/features for the program, so I wound up implementing the physical click as well, via PostMessage. What I did was: Grabbed the handle from the WebBrowser.Handle, looped through the handles, stopped looping at the "Internet Explorer_Server" handle, and then PostMessage()'d a double click to it at the coordinates specified.

I hope this update is helpful for anyone who is reading up on ways to send clicks to the WebBrowser control without invoking a simulated click on a dom element.


回答1:


Have you looked in to the gory details of http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send.aspx ?




回答2:


The send keys is not correct way, is there any sdk or api for c#



来源:https://stackoverflow.com/questions/9653086/sending-simulated-click-via-webbrowser-in-c-sharp-to-flash-object-embedded-in-ht

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!