[英]How to remove only the title of console in a C program?
You can use the function SetWindowText
, like this:您可以使用 function
SetWindowText
,如下所示:
SetWindowText( GetConsoleWindow(), TEXT("") );
This will set the title of the window to an empty string.这会将 window 的标题设置为空字符串。
If you want to remove the entire title bar, then you can use the following code:如果要删除整个标题栏,则可以使用以下代码:
DWORD style = GetWindowLong( GetConsoleWindow(), GWL_STYLE );
style &= ~WS_CAPTION;
SetWindowLong( GetConsoleWindow(), GWL_STYLE, style );
However, moving the window will be a lot harder without a title bar.但是,如果没有标题栏,移动 window 会困难得多。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.