WM_LBUTTONDOWN
The WM_LBUTTONDOWN message is posted when the user presses 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_LBUTTONDOWN
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. To detect that the ALT key was pressed, check whether GetKeyState(VK_MENU) < 0. Note, this must not be GetAsyncKeyState.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.
The WM_LBUTTONDOWN message is posted when the user presses 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_LBUTTONDOWN
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. To detect that the ALT key was pressed, check whether GetKeyState(VK_MENU) < 0. Note, this must not be GetAsyncKeyState.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.
解决方案 »
- 看不懂phostent与twsadata是啥意思
- delphi 关于socket.ReceiveBuf接收超过一定长度就出错的问题,请达人们指点!!!
- 谁有客户端自动升级软件?
- 谁用过TRichView控件?
- 古怪结果
- 救急,怎样用代码自定义打印机张的大小???
- 关于搜索文件FindFirst
- 请问: 发布 midas 服务端 需要购买版权 是什么意思? 谁可以提供控件使用的详细资料
- delphi
- 开始学DELPHI:怎么将一个 .txt中的一个个数据(已用空格格开)读入一个变量(数组)中???
- 高分求助,请问如何单独设定RichEdit的SelText的字体颜色,而其它字的颜色不改变,不够再加,一定给分!!!
- 怎样初始化RadioGroup
yPos = HIWORD(lParam);
fwKeys
Indicates whether various virtual keys are down. It is any combination of the following values: MK_CONTROL Set if the CTRL key is down.
MK_LBUTTON Set if the left mouse button is down.
MK_SHIFT Set if the SHIFT key is down.
老兄现在遇到的问题是这样的:
当我在 Form 上放一个Button 或 其他控件,当鼠标放在这些控件上都可得到控件的名字
而当把几个控件放在 panel上,当鼠标放在控件上,就不能得到panel上的控件名字