参考一下. 从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
从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
::SendMessage(pWnd,WM_LBUTTONUP,x,y);先按下,再放开.
gzup.....
还有别忘了:(两百份呐!)
http://www.csdn.net/expert/topic/645/645252.xml?temp=.8727228
http://www.csdn.net/expert/topic/647/647415.xml?temp=.5680353
WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, WM_LBUTTONUP
同时注意坐标参数
DWORD lParam;lParam = y<< 16 + x;SendMessage(pWnd,WM_LBUTTONDOWN,MK_LBUTTON,lParam);
SendMessage(pWnd,WM_LBUTTONUP,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.
但还是没有解决问题, 依然是有关右键的消息可以响应,但发送的左键消息却怎么也不响应(关于这点我调试了很久,很sure是这样的!)
所以我怀疑该程序能够判断出这个消息是用SendMessage发送的???
有这个可能吗?怎么做的呢?
谢谢!