所有栏目

GetWindowDC

作者:爱百科

GetWindowDC函数:返回hWnd参数所指定的窗口的设备环境。

GetWindowDC介绍

GetWindowDC函数:返回hWnd参数所指定的窗口的设备环境。

GetWindowDC简介

获得的设备环境覆盖了整个窗口(包括非客户区),例如标题栏、菜单、滚动条,以及边框。这使得程序能够在非客户区域实现自定义图形,例如自定义标题或者边框。当不再需要该设备环境时,需要调用ReleaseDC函数释放设备环境。注意,该函数只获得通用设备环境,该设备环境的任何属性改变都不会反映到窗口的私有或者类设备环境中(如果窗口有的话)!

GetWindowDC函数原型

HDC GetWindowDC(HWNDhWnd // 窗口句柄);

api函数名(function):GetWindowDC

GetWindowDC 别名(alias):

GetWindowDC 库名(library):User32

GetWindowDC 操作系统(os):Requires Windows NT 3.1 or later; Requires Windows 95 or later

GetWindowDC 参数表(parameter):

hwnd ----------- Long,将获取其设备场景的窗口?

hWndIdentifies the window with a device context that is to be retrieved.

GetWindowDC 返回值(return):

Long,执行成功为窗口设备场景,失败则为0

If the function succeeds, the return value is the handle of a device context for the specified window. If the function fails, the return value is NULL, indicating an error or an invalid hWnd parameter.

GetWindowDC 说明(description):

获取整个窗口(包括边框、滚动条、标题栏、菜单等)的设备场景

The GetWindowDC function retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area.

GetWindowDC 声明(declare):

Declare Function GetWindowDC Lib "user32" Alias "GetWindowDC" (ByVal hwnd As Long) As Long GetWindowDC 例程(example):

Draw On ScreenWindowFromPointUsing Small Fonts

GetWindowDC .net对应函数(dotnet):

System.Windows.Forms.Form.CreateGraphics.GetHdc

GetWindowDC .net例程(dotnetexample):

GetWindowDC 相关函数(related):

GetDCWindowFromDC

不推荐在vb里使用这个函数。用完后一定要用ReleaseDC函数释放场景

热点导航
教育资讯 知道问答 公考资讯 司法考试 建筑知识 工作范文 大学排名 报考专业 学习方法 句子美文 秒知回答 作业解答 精选答案 知途问学