المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : webbrowser automation with flash content



C# Programming
04-01-2009, 08:52 AM
Currently I'm using the following code which works fine for regular websites, it will click at the ******** in the browser object and everything works perfectly
When I try to use it to click on a flash section of a site however, it doesn't work.
any tips?

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr GetWindow(IntPtr hWnd, uint uCmd);

[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);

int x = 283; // X coordinate of the click
int y = 342; // Y coordinate of the click

IntPtr handle = two.Handle;
StringBuilder className = new StringBuilder(100);

while (className.ToString() != "Internet Explorer_Server")//The class control for the browser
{
handle = GetWindow(handle, 5); // Get a handle to the child window
GetClassName(handle, className, className.Capacity);
}

IntPtr lParam = (IntPtr)((y