不管怎样,只要down,up,move系统都会发送消息,但程序处不处理就是另一码事,
GetMessage
The GetMessage function retrieves a message from the calling thread's message queue and places it in the specified structure. This function can retrieve both messages associated with a specified window and thread messages posted via the PostThreadMessage function. The function retrieves messages that lie within a specified range of message values. GetMessage does not retrieve messages for windows that belong to other threads or applications. BOOL GetMessage(
  LPMSG lpMsg,         // address of structure with message
  HWND hWnd,           // handle of window
  UINT wMsgFilterMin,  // first message
  UINT wMsgFilterMax   // last message
);
 
Parameters
lpMsg 
Pointer to an MSG structure that receives message information from the thread's message queue. 
hWnd 
Handle to the window whose messages are to be retrieved. One value has a special meaning: Value Meaning 
NULL GetMessage retrieves messages for any window that belongs to the calling thread and thread messages posted to the calling thread via PostThreadMessage. 
wMsgFilterMin 
Specifies the integer value of the lowest message value to be retrieved. 
wMsgFilterMax 
Specifies the integer value of the highest message value to be retrieved. 
Return Values
If the function retrieves a message other than WM_QUIT, the return value is nonzero.If the function retrieves the WM_QUIT message, the return value is zero. If there is an error, the return value is -1. For example, the function fails if hWnd is an invalid window handle or lpMsg is an invalid pointer. To get extended error information, callGetLastError.Res
An application typically uses the return value to determine whether to end the main message loop and exit the program. The GetMessage function only retrieves messages associated with the window identified by the hWnd parameter or any of its children, as specified by the IsChild function, and within the range of message values given by the wMsgFilterMin and wMsgFilterMax parameters. If hWnd is NULL, GetMessage retrieves messages for any window that belongs to the calling thread and thread messages posted to the calling thread via PostThreadMessage. GetMessage does not retrieve messages for windows that belong to other threads nor for threads other than the calling thread, even if hWnd is not NULL. Thread messages, posted by the PostThreadMessage function, have a message hWnd value of NULL. If wMsgFilterMin and wMsgFilterMax are both zero, GetMessage returns all available messages (that is, no range filtering is performed). The WM_KEYFIRST and WM_KEYLAST constants can be used as filter values to retrieve all messages related to keyboard input; the WM_MOUSEFIRST and WM_MOUSELAST constants can be used to retrieve all mouse messages. If the wMsgFilterMin and wMsgFilterMax parameters are both zero, the GetMessage function returns all available messages (that is, without performing any filtering). GetMessage does not remove WM_PAINT messages from the queue. The messages remain in the queue until processed. Note that the function return value can be nonzero, zero, or -1. Thus, you should avoid code like this:while (GetMessage( lpMsg, hWnd, 0, 0)) ... 
 
The possibility of a -1 return value means that such code can lead to fatal application errors. QuickInfo
  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in winuser.h.
  Import Library: Use user32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT. 
这个函数可以获得所有的消息
鼠标左健按下主要的消息为WM_LBUTTONDOWN

解决方案 »

  1.   

    哈.哈.不是的了.上面都是MSDN上的说明.不是程序.
    你也可以通过几个API来实现..第一..getwindowlong和setwindowlong使你的程序可以拦截到所有的消息..当你mouse点击的时候.在回调函数中会产生相应的消息...直接处理..
      

  2.   

    '给你一个例子,判断鼠标行为Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Dim i As Integer
    Private Sub Command3_Click()
     End
    End Sub
    Private Sub Timer1_Timer()
      x = GetAsyncKeyState(1)
    If x = -32767 Then'x返回的是16位整数,最高位为1,表明按下
        Text1.Text = Text1.Text + "(单击鼠标左键)"
    End If
    x = GetAsyncKeyState(2)
    If x = -32767 Then
        Text1.Text = Text1.Text + "(单击鼠标右键)"
    End If
    End Sub
      

  3.   

    Label、Image、Line、Shape等所谓的“轻量级控件”实际上根本不是控件
    自然没有消息