网站首页  计算机词典

请输入您要查询的字词:

 

字词 setconsoletitle
释义 SetConsoleTitle
语法:
C++
BOOL WINAPI SetConsoleTitle(
__in LPCTSTR lpConsoleTitle
);
SetConsoleTitle功能
设置当前控制台窗口的标题。
参数
lpConsoleTitle [in]
该字符串将显示在控制台窗口的标题栏。总大小必须小于64K的。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
当进程终止时,系统恢复原来的主机名称。
此函数使用任何Unicode字符或8位字符从控制台的当前代码页。控制台的代码页默认最初系统的OEM代码页。要更改控制台的代码页,使用SetConsoleCP或SetConsoleOutputCP功能,或使用chcp处长或节能模式选择=命令。
实例
下面的示例演示如何检索和修改控制台冠军。
#include
#include
#include
#include
void main()
{
TCHAR szOldTitle[MAX_PATH];
TCHAR szNewTitle[MAX_PATH];
if( GetConsoleTitle(szOldTitle, MAX_PATH) )
{
StringCchPrintf(szNewTitle, MAX_PATH, TEXT("TEST: %s"), szOldTitle);
if( !SetConsoleTitle(szNewTitle) )
printf("SetConsoleTitle failed (%d)\\n", GetLastError());
_getch();
}
}
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWincon.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesSetConsoleTitleW(Unicode)和SetConsoleTitleA(ANSI)的
参见
控制台函数
GetConsoleOriginalTitle
GetConsoleTitle
SetConsoleCP
SetConsoleOutputCP
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SetConsoleTitle Function
Sets the title for the current console window.
Syntax
C++
BOOL WINAPI SetConsoleTitle(
__in LPCTSTR lpConsoleTitle
);
Parameters
lpConsoleTitle [in]
The string to be displayed in the title bar of the console window. The total size must be less than 64K.
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
When the process terminates, the system restores the original console title.
This function uses either Unicode characters or 8-bit characters from the console's current code page. The console's code page defaults initially to the system's OEM code page. To change the console's code page, use the SetConsoleCP or SetConsoleOutputCP functions, or use the chcp or mode con cp select= commands.
Examples
The following example shows how to retrieve and modify the console title.
#include
#include
#include
#include
void main()
{
TCHAR szOldTitle[MAX_PATH];
TCHAR szNewTitle[MAX_PATH];
if( GetConsoleTitle(szOldTitle, MAX_PATH) )
{
StringCchPrintf(szNewTitle, MAX_PATH, TEXT("TEST: %s"), szOldTitle);
if( !SetConsoleTitle(szNewTitle) )
printf("SetConsoleTitle failed (%d)\\n", GetLastError());
_getch();
}
}
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWincon.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesSetConsoleTitleW (Unicode) and SetConsoleTitleA (ANSI)
See Also
Console Functions
GetConsoleOriginalTitle
GetConsoleTitle
SetConsoleCP
SetConsoleOutputCP
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms686050(VS.85).aspx\n
随便看

 

计算机英汉双解词典包含34412条计算机术语英汉翻译词条,基本涵盖了全部常用计算机术语的翻译及用法,是计算机学习及翻译工作的有利工具。

 

Copyright © 2021-2025 foosec.com All Rights Reserved
更新时间:2026/10/24 0:37:35