* fhandler_console.cc (set_console_title): Convert title string to

wchar_t and call SetConsoleTitleW.
This commit is contained in:
Corinna Vinschen 2009-06-04 14:59:47 +00:00
parent f17f20c139
commit 7774a4b029
2 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2009-06-04 Corinna Vinschen <corinna@vinschen.de>
* fhandler_console.cc (set_console_title): Convert title string to
wchar_t and call SetConsoleTitleW.
2009-06-04 Corinna Vinschen <corinna@vinschen.de>
* fhandler_console.cc (fhandler_console::read): Allow Ctrl-Space to

View File

@ -1892,12 +1892,11 @@ fhandler_console::set_close_on_exec (bool val)
void __stdcall
set_console_title (char *title)
{
char buf[257];
strncpy (buf, title, sizeof (buf) - 1);
buf[sizeof (buf) - 1] = '\0';
wchar_t buf[257];
sys_mbstowcs (buf, sizeof buf, title);
lock_ttys here (15000);
SetConsoleTitle (buf);
debug_printf ("title '%s'", buf);
SetConsoleTitleW (buf);
debug_printf ("title '%W'", buf);
}
void