网站首页  词典首页

请输入您要查询的函数:

 

术语 createcaret
释义 CreateCaret
语法:
BOOL CreateCaret( HWND hWnd,
HBITMAP hBitmap,
int nWidth,
int nHeight
);
CreateCaret功能
该CreateCaret函数创建一个新的系统插入形状和分配权的插入到指定的窗口。插入符号的形状可以是一个线,一个块或位图。
参数
hWnd
[in]的窗口句柄拥有插入符。
hBitmap
[in]位图的句柄定义插入形状。如果该参数为NULL,则插入是牢固的。如果该参数(HBITMAP)1,插入符是灰色的。如果该参数是一个位图句柄,插入符号是指定位图。位图句柄必须已经建立了CreateBitmap,CreateDIBitmap,或LoadBitmap功能。
如果hBitmap是一个位图句柄,CreateCaret忽略nWidth和nHeight参数,该位图定义了自己的宽度和高度。
nWidth
[in]指定的逻辑单位插入宽度。如果此参数为0,宽度设置为系统定义的窗口边框的宽度。如果hBitmap是一个位图句柄,CreateCaret忽略此参数。
nHeight
[in]指定的高度,以逻辑单位,插入符。如果此参数为0,高度设置为系统定义的窗口边框的高度。如果hBitmap是一个位图句柄,CreateCaret忽略此参数。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
在nWidth和nHeight参数指定插入符号的宽度和高度的逻辑单位;确切的宽度和高度以像素为单位,在窗口的映射模式而定。
CreateCaret自动销毁前插入形状,如果有的话,不管窗口拥有插入符。插入符号是隐藏的,直到应用程序调用ShowCaret功能,使插入符可见。
该系统提供每个队列插入。窗口应建立一个插入只有当它具有键盘焦点或处于活动状态。窗口前应销毁失去键盘焦点变为非活动状态或插入符。
您可以通过使用GetSystemMetrics函数的宽度或系统的窗口边框的高度,指定SM_CXBORDER和SM_CYBORDER价值。使用窗口边框的宽度或高度保证了插入符将高分辨率的屏幕上可见。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为Unicode版本。
参见
插入号概况,CreateBitmap,CreateDIBitmap,DestroyCaret,GetSystemMetrics,HideCaret,LoadBitmap,ShowCaret
==英文原文==CreateCaret Function
The CreateCaret function creates a new shape for the system caret and assigns ownership of the caret to the specified window. The caret shape can be a line, a block, or a bitmap.
Syntax
BOOL CreateCaret( HWND hWnd,
HBITMAP hBitmap,
int nWidth,
int nHeight
);
Parameters
hWnd
[in] Handle to the window that owns the caret.
hBitmap
[in] Handle to the bitmap that defines the caret shape. If this parameter is NULL, the caret is solid. If this parameter is (HBITMAP) 1, the caret is gray. If this parameter is a bitmap handle, the caret is the specified bitmap. The bitmap handle must have been created by the CreateBitmap , CreateDIBitmap , or LoadBitmap function.
If hBitmap is a bitmap handle, CreateCaret ignores the nWidth and nHeight parameters; the bitmap defines its own width and height.
nWidth
[in] Specifies the width of the caret in logical units. If this parameter is zero, the width is set to the system-defined window border width. If hBitmap is a bitmap handle, CreateCaret ignores this parameter.
nHeight
[in] Specifies the height, in logical units, of the caret. If this parameter is zero, the height is set to the system-defined window border height. If hBitmap is a bitmap handle, CreateCaret ignores this parameter.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
The nWidth and nHeight parameters specify the caret's width and height, in logical units; the exact width and height, in pixels, depend on the window's mapping mode.
CreateCaret automatically destroys the previous caret shape, if any, regardless of the window that owns the caret. The caret is hidden until the application calls the ShowCaret function to make the caret visible.
The system provides one caret per queue. A window should create a caret only when it has the keyboard focus or is active. The window should destroy the caret before losing the keyboard focus or becoming inactive.
You can retrieve the width or height of the system's window border by using the GetSystemMetrics function, specifying the SM_CXBORDER and SM_CYBORDER values. Using the window border width or height guarantees that the caret will be visible on a high-resolution screen.
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
Carets Overview , CreateBitmap , CreateDIBitmap , DestroyCaret , GetSystemMetrics , HideCaret , LoadBitmap , ShowCaret
==原始网址==http://msdn.microsoft.com/en-us/library/ms648399(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:22:11