网站首页  词典首页

请输入您要查询的函数:

 

术语 getstockobject
释义 GetStockObject
语法:
HGDIOBJ GetStockObject(
__in int fnObject
);
GetStockObject函数
该GetStockObject函数检索句柄股票的钢笔,画笔,字体或调色板之一。
参数
fnObject [in]
该股票的对象类型。此参数可以是下列值之一。
ValueMeaning
BLACK_BRUSHBlack刷。
DKGRAY_BRUSHDark灰色画笔。
DC_BRUSHSolid颜色刷。默认颜色为白色。颜色可以更改通过使用SetDCBrushColor函数。有关详细信息,请参见备注部分。
GRAY_BRUSHGray刷。
HOLLOW_BRUSHHollow刷(相当于NULL_BRUSH)。
LTGRAY_BRUSHLight灰色画笔。
NULL_BRUSHNull刷(相当于HOLLOW_BRUSH)。
WHITE_BRUSHWhite刷。
BLACK_PENBlack笔。
DC_PENSolid笔颜色。默认颜色为白色。颜色可以更改通过使用SetDCPenColor功能。有关详细信息,请参见备注部分。
NULL_PENNULL笔。空笔绘制什么。
WHITE_PENWhite笔。
ANSI_FIXED_FONTWindows固定摊位(等宽)系统字体。
ANSI_VAR_FONTWindows可变间距(比例空间)的系统字体。
DEVICE_DEFAULT_FONTDevice依赖字体。
DEFAULT_GUI_FONTDefault字体的用户界面对象,如菜单和对话框。不建议您使用DEFAULT_GUI_FONT或SYSTEM_FONT获得通过对话和Windows使用的字体;有关详细信息,请参见备注部分。
默认字体为宋体。
OEM_FIXED_FONTOriginal设备制造商(OEM),依赖固定摊位(等宽)字体。
SYSTEM_FONTSystem字体。默认情况下,系统使用系统字体绘制的菜单,对话框控件,和文本。不建议您使用DEFAULT_GUI_FONT或SYSTEM_FONT获得通过对话和Windows使用的字体;有关详细信息,请参见备注部分。
默认的系统字体是宋体。
SYSTEM_FIXED_FONTFixed间距(等宽)系统字体。这种股票对象只提供了兼容性与16位Windows版本早于3.0。
DEFAULT_PALETTEDefault调色板。这个调色板中包含的静态系统调色板的颜色。
返回值
如果函数成功,返回值是一个句柄请求逻辑对象。
如果函数失败,返回值为NULL。
备注
不建议您采用这种方法来获取当前字体的对话和Windows使用。相反,使用与SPI_GETNONCLIENTMETRICS参数使用SystemParametersInfo函数来检索当前字体。 SystemParametersInfo将考虑到当前主题,并提供字幕,菜单字体信息和消息对话。
使用DKGRAY_BRUSH,GRAY_BRUSH和LTGRAY_BRUSH股票对象不仅符合CS_HREDRAW和CS_VREDRAW样式窗口。使用任何其他样式的窗口一个灰色的股票刷子可以导致一个窗口后,刷模式偏心是移动或调整大小。股票刷的起源不能调整。
在HOLLOW_BRUSH和NULL_BRUSH股票对象是等价的。
没有必要(但不是有害)删除调用DeleteObject股票对象。
双方DC_BRUSH和DC_PEN可以互换使用的像BLACK_BRUSH和BLACK_PEN其他股市的对象。有关检索当前钢笔或画笔颜色,见GetDCBrushColor和GetDCPenColor信息。请参阅设置颜色的设置为例,笔或画笔颜色。同一个DC_BRUSH或DC_PEN参数GetStockObject函数可以互换使用的SetDCPenColor和SetDCBrushColor功能。
实例
有关示例,请参阅设置笔或画笔颜色。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
设备上下文概述
设备上下文函数
DeleteObject
SelectObject
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetStockObject Function
The GetStockObject function retrieves a handle to one of the stock pens, brushes, fonts, or palettes.
Syntax
HGDIOBJ GetStockObject(
__in int fnObject
);
Parameters
fnObject [in]
The type of stock object. This parameter can be one of the following values.
ValueMeaning
BLACK_BRUSHBlack brush.
DKGRAY_BRUSHDark gray brush.
DC_BRUSHSolid color brush. The default color is white. The color can be changed by using the SetDCBrushColor function. For more information, see the Remarks section.
GRAY_BRUSHGray brush.
HOLLOW_BRUSHHollow brush (equivalent to NULL_BRUSH).
LTGRAY_BRUSHLight gray brush.
NULL_BRUSHNull brush (equivalent to HOLLOW_BRUSH).
WHITE_BRUSHWhite brush.
BLACK_PENBlack pen.
DC_PENSolid pen color. The default color is white. The color can be changed by using the SetDCPenColor function. For more information, see the Remarks section.
NULL_PENNULL pen. The null pen draws nothing.
WHITE_PENWhite pen.
ANSI_FIXED_FONTWindows fixed-pitch (monospace) system font.
ANSI_VAR_FONTWindows variable-pitch (proportional space) system font.
DEVICE_DEFAULT_FONTDevice-dependent font.
DEFAULT_GUI_FONTDefault font for user interface objects such as menus and dialog boxes. It is not recommended that you use DEFAULT_GUI_FONT or SYSTEM_FONT to obtain the font used by dialogs and windows; for more information, see the remarks section.
The default font is Tahoma.
OEM_FIXED_FONTOriginal equipment manufacturer (OEM) dependent fixed-pitch (monospace) font.
SYSTEM_FONTSystem font. By default, the system uses the system font to draw menus, dialog box controls, and text. It is not recommended that you use DEFAULT_GUI_FONT or SYSTEM_FONT to obtain the font used by dialogs and windows; for more information, see the remarks section.
The default system font is Tahoma.
SYSTEM_FIXED_FONTFixed-pitch (monospace) system font. This stock object is provided only for compatibility with 16-bit Windows versions earlier than 3.0.
DEFAULT_PALETTEDefault palette. This palette consists of the static colors in the system palette.

Return Value
If the function succeeds, the return value is a handle to the requested logical object.
If the function fails, the return value is NULL.
Remarks
It is not recommended that you employ this method to obtain the current font used by dialogs and windows. Instead, use the SystemParametersInfo function with the SPI_GETNONCLIENTMETRICS parameter to retrieve the current font. SystemParametersInfo will take into account the current theme and provides font information for captions, menus, and message dialogs.
Use the DKGRAY_BRUSH, GRAY_BRUSH, and LTGRAY_BRUSH stock objects only in windows with the CS_HREDRAW and CS_VREDRAW styles. Using a gray stock brush in any other style of window can lead to misalignment of brush patterns after a window is moved or sized. The origins of stock brushes cannot be adjusted.
The HOLLOW_BRUSH and NULL_BRUSH stock objects are equivalent.
It is not necessary (but it is not harmful) to delete stock objects by calling DeleteObject .
Both DC_BRUSH and DC_PEN can be used interchangeably with other stock objects like BLACK_BRUSH and BLACK_PEN. For information on retrieving the current pen or brush color, see GetDCBrushColor and GetDCPenColor . See Setting the Pen or Brush Color for an example of setting colors. The GetStockObject function with an argument of DC_BRUSH or DC_PEN can be used interchangeably with the SetDCPenColor and SetDCBrushColor functions.
Examples
For an example, see Setting the Pen or Brush Color.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
See Also
Device Contexts Overview
Device Context Functions
DeleteObject
SelectObject
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144925(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:15:38