网站首页  词典首页

请输入您要查询的函数:

 

术语 setconsolewindowinfo
释义 SetConsoleWindowInfo
语法:
C++
BOOL WINAPI SetConsoleWindowInfo(
__in HANDLE hConsoleOutput,
__in BOOL bAbsolute,
__in const SMALL_RECT *lpConsoleWindow
);
SetConsoleWindowInfo功能
设置当前的规模和控制台屏幕缓冲区的窗口位置。
参数
hConsoleOutput [in]
句柄到控制台屏幕缓冲区。句柄必须有GENERIC_READ访问的权利。有关更多信息,参见控制台缓冲区安全和访问权限。
bAbsolute [in]
如果此参数为TRUE,指定新的坐标左上角和低窗口右侧的角落。如果它是假的坐标是相对于当前窗口,角坐标。
lpConsoleWindow [in]
一个 SMALL_RECT结构的指针,指定新的左上角和低窗口右侧的角落。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
函数失败如果指定的窗口矩形超出控制台屏幕缓冲区界限。这意味着该lpConsoleWindow矩形的顶部和左侧的成员(或计算的顶部和左侧的坐标,如果bAbsolute为FALSE)不能小于零。同样,底部和右侧的成员(或计算出的底部和右侧坐标)不能大于(屏幕缓冲高度- 1)和(屏幕缓冲区的宽度- 1),分别为。该功能也没有,如果有合适的成员(或右坐标)小于或等于左成员(或左坐标计算),或底部的成员(或底部坐标计算)计算,小于或等于高级成员(顶部或计算坐标)。
对于游戏机超过一个屏幕缓冲区,改变一个屏幕缓冲区窗口的位置,不影响其他屏幕缓冲区的窗口位置。
要确定当前的大小和屏幕缓冲区的窗口位置,使用GetConsoleScreenBufferInfo功能。此函数也返回窗口的最大大小,鉴于目前的屏幕缓冲区大小,目前的字体大小和屏幕的大小。该GetLargestConsoleWindowSize函数返回的最大窗口大小鉴于目前的字体和屏幕尺寸,但它不考虑控制台屏幕缓冲区大小。
SetConsoleWindowInfo可用于滚动的控制台转移不改变其大小窗口的矩形位置屏幕缓冲区的内容。
实例
举例说,一看到滚动屏幕缓冲区的窗口。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWincon.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
控制台函数
GetConsoleScreenBufferInfo
GetLargestConsoleWindowSize
ScrollConsoleScreenBuffer
滚动屏幕缓冲区
SMALL_RECT
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SetConsoleWindowInfo Function
Sets the current size and position of a console screen buffer's window.
Syntax
C++
BOOL WINAPI SetConsoleWindowInfo(
__in HANDLE hConsoleOutput,
__in BOOL bAbsolute,
__in const SMALL_RECT *lpConsoleWindow
);
Parameters
hConsoleOutput [in]
A handle to the console screen buffer. The handle must have the GENERIC_READ access right. For more information, see Console Buffer Security and Access Rights .
bAbsolute [in]
If this parameter is TRUE, the coordinates specify the new upper-left and lower-right corners of the window. If it is FALSE, the coordinates are relative to the current window-corner coordinates.
lpConsoleWindow [in]
A pointer to a SMALL_RECT structure that specifies the new upper-left and lower-right corners of the window.
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 function fails if the specified window rectangle extends beyond the boundaries of the console screen buffer. This means that the Top and Left members of the lpConsoleWindow rectangle (or the calculated top and left coordinates, if bAbsolute is FALSE) cannot be less than zero. Similarly, the Bottom and Right members (or the calculated bottom and right coordinates) cannot be greater than (screen buffer height – 1) and (screen buffer width – 1), respectively. The function also fails if the Right member (or calculated right coordinate) is less than or equal to the Left member (or calculated left coordinate) or if the Bottom member (or calculated bottom coordinate) is less than or equal to the Top member (or calculated top coordinate).
For consoles with more than one screen buffer, changing the window location for one screen buffer does not affect the window locations of the other screen buffers.
To determine the current size and position of a screen buffer's window, use the GetConsoleScreenBufferInfo function. This function also returns the maximum size of the window, given the current screen buffer size, the current font size, and the screen size. The GetLargestConsoleWindowSize function returns the maximum window size given the current font and screen sizes, but it does not consider the size of the console screen buffer.
SetConsoleWindowInfo can be used to scroll the contents of the console screen buffer by shifting the position of the window rectangle without changing its size.
Examples
For an example, see Scrolling a Screen Buffer's Window .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWincon.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Console Functions
GetConsoleScreenBufferInfo
GetLargestConsoleWindowSize
ScrollConsoleScreenBuffer
Scrolling the Screen Buffer
SMALL_RECT
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms686125(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:16:15