网站首页  词典首页

请输入您要查询的函数:

 

术语 setcursor
释义 SetCursor
语法:
HCURSOR SetCursor( HCURSOR hCursor
);
SetCursor函数
该SetCursor函数设置光标形状。
参数
hCursor
[in]
光标句柄。游标必须已经建立了CreateCursor函数或LoadCursor或LoadImage函数加载。如果该参数为NULL,则删除光标从屏幕上。
Windows 95/98/Me中:宽度和高度的游标必须由SM_CXCURSOR和SM_CYCURSOR GetSystemMetrics函数返回的值。对于Microsoft Windows 95,或者光标位深度必须与显示或光标的位深度必须是单色。然而,Windows 98和Windows 98中,如果光标位深度不匹配显示器的位深度,然后将光标转换为4bpp VGA颜色。
返回值
返回值是处理到以前的光标,如果有1。
如果没有以前的游标,返回值为NULL。
备注
光标设置只有在新的光标从以前的光标不同,否则,该函数立即返回。
光标是一个共享资源。窗口应设置光标形状只有当光标在客户区或当窗口捕获鼠标输入。在没有鼠标系统,窗口应恢复以前的光标,光标前离开客户区或之前,将放弃控制到另一个窗口。
如果您的应用程序必须设置光标,而它在一个窗口中,确保在指定的窗口类的类光标设置为NULL。如果类光标不是NULL,系统还原每类光标移动鼠标的时间。
光标不会显示在屏幕上,如果内部光标显示计数小于零。出现这种情况如果应用程序使用ShowCursor函数隐藏光标超过显示光标倍。
例如
有关示例,请参见显示游标。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为Unicode版本。
参见
游标概述,CreateCursor,GetCursor,GetSystemMetrics,LoadCursor,的LoadImage,SetCursorPos,ShowCursor
==英文原文==SetCursor Function
The SetCursor function sets the cursor shape.
Syntax
HCURSOR SetCursor( HCURSOR hCursor
);
Parameters
hCursor
[in]
Handle to the cursor. The cursor must have been created by the CreateCursor function or loaded by the LoadCursor or LoadImage function. If this parameter is NULL, the cursor is removed from the screen.
Windows 95/98/Me: The width and height of the cursor must be the values returned by the GetSystemMetrics function for SM_CXCURSOR and SM_CYCURSOR. For Microsoft Windows 95, either the cursor bit depth must match the bit depth of the display or the cursor must be monochrome. However, for Windows 98 and Windows 98, if the cursor bit depth does not match the bit depth of the display then the cursor is converted to 4bpp VGA color.
Return Value
The return value is the handle to the previous cursor, if there was one.
If there was no previous cursor, the return value is NULL.
Remarks
The cursor is set only if the new cursor is different from the previous cursor; otherwise, the function returns immediately.
The cursor is a shared resource. A window should set the cursor shape only when the cursor is in its client area or when the window is capturing mouse input. In systems without a mouse, the window should restore the previous cursor before the cursor leaves the client area or before it relinquishes control to another window.
If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved.
The cursor is not shown on the screen if the internal cursor display count is less than zero. This occurs if the application uses the ShowCursor function to hide the cursor more times than to show the cursor.
Example
For an example, see Displaying a Cursor .
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
Cursors Overview , CreateCursor , GetCursor , GetSystemMetrics , LoadCursor , LoadImage , SetCursorPos , ShowCursor
==原始网址==http://msdn.microsoft.com/en-us/library/ms648393(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:53