词条 | GetWindowDC |
释义 | GetWindowDC函数:返回hWnd参数所指定的窗口的设备环境。 获得的设备环境覆盖了整个窗口(包括非客户区),例如标题栏、菜单、滚动条,以及边框。这使得程序能够在非客户区域实现自定义图形,例如自定义标题或者边框。当不再需要该设备环境时,需要调用ReleaseDC函数释放设备环境。注意,该函数只获得通用设备环境,该设备环境的任何属性改变都不会反映到窗口的私有或者类设备环境中(如果窗口有的话)! 函数原型: HDC GetWindowDC(HWND hWnd // 窗口句柄); 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 FontsGetWindowDC .net对应函数(dotnet): System.Windows.Forms.Form.CreateGraphics.GetHdc GetWindowDC .net例程(dotnet example): GetWindowDC 相关函数(related): GetDCWindowFromDC 不推荐在vb里使用这个函数。用完后一定要用ReleaseDC函数释放场景 |
随便看 |
|
百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。