Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# webbrowser
Hi i have a c# application and an embedded browser in it.
Its task is to find a link and then right click on it and click on properties! mouse moves programmatically so i need to find properties in righ click menu! Can you help me how to do this? I tried pressing 'r' after right click, but it didn't work on some computers! So i need to do it by moving mouse! Here is my code for finding a link and right clicking:
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 + 5;
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);

 
can any one help me?or any other idea for reaching properties on right click meny is welcomed
Tanx
Posted 29-Aug-12 7:25am
Edited 29-Aug-12 9:23am
(no name)110.4K
v2
Comments
Nueman at 29-Aug-12 14:18pm
   
Please edit your question and use the space bar to separate sentences. Your post is very hard to read. Thanks.
khangaldi at 29-Aug-12 14:27pm
   
im so sorry about that
Nueman at 29-Aug-12 14:43pm
   
No problem with me. :) I am just trying to help you get an answer to your question. You have to consider the people that will be reading your question and use appropriate spacing, punctuation, and capitalization.
Zoltán Zörgő at 30-Aug-12 0:40am
   
I can not imagine, what is the purpose of this. Perhaps there is a more simpler way to achieve what you want, without webbrowser. Could you tell us, what's the goal of the project?

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

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 105
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 29 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100