Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi
i have C# application and an embedded browser in it,it's task is to go to my web site and right click on a link and press 'r' so the properties window appear(i move the mouse with code) it works on my laptop perfectly but when i install it on my pc or any other device when the program does this command:
C#
SendKeys.Send("r");


i start to see and error telling me : Unhandled exeption in your application.the requestetd resource is in use.(Exeption from HRESULT:0x800700AA)

here is my code which works on my laptop
C#
int x = getXoffset(link);
int y = getYoffset(link);
webBrowser1.Document.Window.ScrollTo(x, y);
Linker.Win32.POINT p2 = new Linker.Win32.POINT();
webBrowser1.Focus();
p2.x = webBrowser1.Left + 10;
p2.y = webBrowser1.Top + 10;
Linker.Win32.ClientToScreen(this.Handle, ref p2);
Linker.Win32.SetCursorPos(p2.x, p2.y);
MouseOperations.GetCursorPosition();
MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.LeftDown);
MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.RightDown);
MouseOperations.MouseEvent(MouseOperations.MouseEventFlags.RightUp);
SendKeys.Send("r");



what should i do?what even this error means?

Tanx
Posted
Updated 28-Aug-12 8:33am
v2
Comments
[no name] 28-Aug-12 14:43pm    
Nearest thing that I could figure is that it's the webbrowser control actually throwing that error.
Sarrrva 28-Aug-12 14:49pm    
may be your webbrowser control in disable... check control state

take a related link

http://vbdotnet.canbal.com/view.php?sessionid=SNnxMhJzBYrWeRKV3V9kecrx%2F%2Fv95oLRi5HgyiMYZoU%3D


regards
sarva
khangaldi 28-Aug-12 15:22pm    
is there any other way to call properties?beside pressing 'r'?using mouse isn't a good solution since different screens have different resolution and i'm using pixels to move mouse
lukeer 29-Aug-12 0:48am    
Since you say it's your website, maybe you can build something like a minimal API into it?
John d. Bartels 21-Oct-12 13:05pm    
Have you tried SendKeys.SendWait('r');

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900