0
您好我有一個C#應用程序和嵌入式瀏覽器,它的任務是找到一個鏈接,然後右鍵單擊它並單擊屬性!如何找到右鍵單擊屬性C#web瀏覽器的Contextmenu
鼠標以編程方式移動,所以我需要在右擊菜單中找到屬性!
你能幫我怎麼做嗎?
我試圖按'右'後右鍵單擊,但它沒有在一些計算機上工作!
所以我需要通過移動鼠標!
這裏是我找到一個鏈接,然後右鍵單擊代碼:
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);
爲達成右鍵點擊MENY性質的任何其他的想法表示歡迎
或有什麼方法可以在右鍵單擊菜單中計數項目,然後選擇屬性的最後一個項目? –
你到底想做什麼? – KF2
正如我解釋我的應用程序找到一個鏈接,例如,當它加載www.example.com它找到鏈接命名:測試,然後右鍵點擊int,然後我想打開屬性 –