先mousedown,再mouseup
就可以了。

解决方案 »

  1.   

    试试 this->SendMessage(WM_LBUTTONDBLCLK......
      

  2.   

    参考一下.
    从MSDN中拷出来的.
    有用的话记的给分哦. 
      Platform SDK: Windows User Interface 
    WM_LBUTTONDBLCLK
    The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse. A window receives this message through its WindowProc function. LRESULT CALLBACK WindowProc(
      HWND hwnd,       // handle to window
      UINT uMsg,       // WM_LBUTTONDBLCLK
      WPARAM wParam,   // key indicator
      LPARAM lParam    // horizontal and vertical position
    );
    Parameters
    wParam 
    Indicates whether various virtual keys are down. This parameter can be one or more of the following values. Value Description 
    MK_CONTROL The CTRL key is down. 
    MK_LBUTTON The left mouse button is down. 
    MK_MBUTTON The middle mouse button is down. 
    MK_RBUTTON The right mouse button is down. 
    MK_SHIFT The SHIFT key is down. 
    MK_XBUTTON1 Windows 2000: The first X button is down. 
    MK_XBUTTON2 Windows 2000: The second X button is down. 
    lParam 
    The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area. 
    The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area. Return Values
    If an application processes this message, it should return zero. Res
    Use the following code to obtain the horizontal and vertical position:xPos = GET_X_LPARAM(lParam); 
    yPos = GET_Y_LPARAM(lParam); 
    You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure. Only windows that have the CS_DBLCLKS style can receive WM_LBUTTONDBLCLK messages, which the system generates whenever the user presses, releases, and again presses the left mouse button within the system's double-click time limit. Double-clicking the left mouse button actually generates a sequence of four messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, and WM_LBUTTONUP. Requirements 
      Windows NT/2000: Requires Windows NT 3.1 or later.
      Windows 95/98: Requires Windows 95 or later.
      Header: Declared in Winuser.h; include Windows.h.See Also
    Mouse Input Overview, Mouse Input Messages, GET_X_LPARAM, GET_Y_LPARAM, GetCapture, GetDoubleClickTime, MAKEPOINTS, POINTS, SetCapture, SetDoubleClickTime, WM_LBUTTONDOWN, WM_LBUTTONUP 
      

  3.   

    你应该这样写:::SendMessage(pWnd,WM_LBUTTONDOWN,x,y);
    ::SendMessage(pWnd,WM_LBUTTONUP,x,y);先按下,再放开.
      

  4.   


    gzup..... 
     
      
      还有别忘了:(两百份呐!)
    http://www.csdn.net/expert/topic/645/645252.xml?temp=.8727228
    http://www.csdn.net/expert/topic/647/647415.xml?temp=.5680353 
     
     
      

  5.   

    要想用SendMessage模拟双击,需要按如下顺序发送:
    WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, WM_LBUTTONUP
    同时注意坐标参数
      

  6.   


    DWORD lParam;lParam = y<< 16 + x;SendMessage(pWnd,WM_LBUTTONDOWN,MK_LBUTTON,lParam);
    SendMessage(pWnd,WM_LBUTTONUP,MK_LBUTTON,lParam);这样就可以了。
      

  7.   

    如果你想双击鼠标左键,连续2个down, up消息就可以了,如下:lParam = y<< 16 + x;SendMessage(pWnd,WM_LBUTTONDOWN,MK_LBUTTON,lParam);
    SendMessage(pWnd,WM_LBUTTONUP,MK_LBUTTON,lParam);
    SendMessage(pWnd,WM_LBUTTONDOWN,MK_LBUTTON,lParam);
    SendMessage(pWnd,WM_LBUTTONUP,MK_LBUTTON,lParam);通过spy++发现,很多应用程序没有产生WM_LBUTTONDBLCLK消息,而是2个连续的
    鼠标左键点击消息。不过如果对其他应用程序发送这些消息,推荐使用PostMessage
    而不是SendMessage.
      

  8.   

    谢谢大家!
    但还是没有解决问题, 依然是有关右键的消息可以响应,但发送的左键消息却怎么也不响应(关于这点我调试了很久,很sure是这样的!)
    所以我怀疑该程序能够判断出这个消息是用SendMessage发送的???
    有这个可能吗?怎么做的呢?
    谢谢!
      

  9.   

    你的pWnd是什么?不会是窗口的指针吧?我记得::SendMessage用的是窗口的句柄HWND啊。
      

  10.   

    原来问题出在PostMessage只是发给该窗口,窗口里的其它东东不会响应,要先用SetCursorPos,再mouse_event就OK了,谢谢大家,给分啦!