网站首页  词典首页

请输入您要查询的函数:

 

术语 setcapture
释义 SetCapture
语法:
HWND SetCapture( HWND hWnd
);
SetCapture函数
该SetCapture函数设置鼠标捕获到指定的窗口属于当前线程。 SetCapture捕获鼠标输入或鼠标时在捕获窗口,或者当鼠标按钮被按下,而鼠标在捕获窗口和按钮仍然下降。一次只能有一个时间窗口可以捕获鼠标。
如果鼠标光标由另一个线程创建一个窗口,系统将直接鼠标输入到指定的窗口仅当鼠标按钮了。
参数
hWnd
[in]句柄当前线程捕获鼠标的窗口。
返回值
返回值是一个窗口句柄先前捕获鼠标。 If there is no such window, the return value is NULL.
备注
只有前台窗口可以捕获鼠标。当一个背景窗口尝试这样做,窗口只接收邮件的鼠标事件时出现的光标热点在窗口的可见部分。另外,即使前台窗口已经抓住了鼠标,用户仍然可以单击另一个窗口,把它推到前台。
当窗口不再要求所有鼠标输入的线程创建窗口应调用ReleaseCapture函数释放鼠标。
此函数不能用于捕获鼠标输入另一个进程的意思。
When the mouse is captured, menu hotkeys and other keyboard accelerators do not work.
在Windows 95/98/Me:调用SetCapture导致窗口失去鼠标捕获接收WM_CAPTURECHANGED消息。
例如
有关示例,请使用鼠标绘制线。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为Unicode版本。
参见
鼠标输入,GetCapture,ReleaseCapture,WM_CAPTURECHANGED
==英文原文==SetCapture Function
The SetCapture function sets the mouse capture to the specified window belonging to the current thread. SetCapture captures mouse input either when the mouse is over the capturing window, or when the mouse button was pressed while the mouse was over the capturing window and the button is still down. Only one window at a time can capture the mouse.
If the mouse cursor is over a window created by another thread, the system will direct mouse input to the specified window only if a mouse button is down.
Syntax
HWND SetCapture( HWND hWnd
);
Parameters
hWnd
[in] Handle to the window in the current thread that is to capture the mouse.
Return Value
The return value is a handle to the window that had previously captured the mouse. If there is no such window, the return value is NULL.
Remarks
Only the foreground window can capture the mouse. When a background window attempts to do so, the window receives messages only for mouse events that occur when the cursor hot spot is within the visible portion of the window. Also, even if the foreground window has captured the mouse, the user can still click another window, bringing it to the foreground.
When the window no longer requires all mouse input, the thread that created the window should call the ReleaseCapture function to release the mouse.
This function cannot be used to capture mouse input meant for another process.
When the mouse is captured, menu hotkeys and other keyboard accelerators do not work.
Windows 95/98/Me: Calling SetCapture causes the window that is losing the mouse capture to receive a WM_CAPTURECHANGED message.
Example
For an example, see Drawing Lines with the Mouse .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as Unicode version.
See Also
Mouse Input , GetCapture , ReleaseCapture , WM_CAPTURECHANGED
==原始网址==http://msdn.microsoft.com/en-us/library/ms646262(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:19:52