Thread: Programmically simulate clicking on webbrowser2 object

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    114

    Programmically simulate clicking on webbrowser2 object

    Programmically simulate clicking on webbrowser2 object

    how do i Programmically click on webbrowser2 object?

    i tried
    Code:
    m_webbrowser.SendMessage(WM_LBUTTONDBLCLK,MK_LBUTTON, (LPARAM)MAKELONG(291, 125) );
    		
    m_webbrowser.SendMessage(WM_LBUTTONDOWN,MK_LBUTTON, (LPARAM)MAKELONG(291, 125) );
    but they do not work. is there anyway to simulate clicks on it?
    there are some conditions that i must strictly follow
    - i do not want my actual mouse cursor to move at all.
    - the click must be relative to the control, not to the screen

    rdgs, hanhao
    using VC++ 6.0

  2. #2
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    then you have to offset the coordinates relative to the windows RECT. get the rect of the window in question, then add the relative offset to find the target coordinates. AFAIK, it wont move the mose cursor.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Programmically simulate clicking on webbrowser2 object
    By hanhao in forum Windows Programming
    Replies: 1
    Last Post: 06-24-2007, 10:34 PM
  2. circular doubly linked list help
    By gunnerz in forum C++ Programming
    Replies: 5
    Last Post: 04-28-2007, 08:38 PM
  3. Clicking an Object in OpenGL.
    By gpr1me in forum Game Programming
    Replies: 5
    Last Post: 03-26-2006, 10:12 PM
  4. Question on l-values.
    By Hulag in forum C++ Programming
    Replies: 6
    Last Post: 10-13-2005, 04:33 PM
  5. A question about constructors...
    By Wolve in forum C++ Programming
    Replies: 9
    Last Post: 05-04-2005, 04:24 PM