From 71cf45cfa342827070f1bd2ea413d83d99268922 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Sun, 29 Jun 2008 17:26:38 +0000 Subject: [PATCH] If there is no process name passed in, try to obtain the console title. If that does not work either, use default of cmd.exe as a title. - fixes bug 3397 svn path=/trunk/; revision=34192 --- reactos/dll/cpl/console/console.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/reactos/dll/cpl/console/console.c b/reactos/dll/cpl/console/console.c index a9bea93af9f..cdbd817086f 100644 --- a/reactos/dll/cpl/console/console.c +++ b/reactos/dll/cpl/console/console.c @@ -168,6 +168,7 @@ InitApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) PROPSHEETHEADER psh; INT i=0; PConsoleInfo pConInfo; + WCHAR szTitle[100]; PConsoleInfo pSharedInfo = (PConsoleInfo)wParam; UNREFERENCED_PARAMETER(uMsg); @@ -222,17 +223,24 @@ InitApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam) ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW; - if(_tcslen(pConInfo->szProcessName)) { psh.dwFlags |= PSH_PROPTITLE; psh.pszCaption = pConInfo->szProcessName; - } + } + else + { + if (!GetConsoleTitleW(szTitle, sizeof(szTitle)/sizeof(WCHAR))) + { + _tcscpy(szTitle, _T("cmd.exe")); + } + szTitle[(sizeof(szTitle)/sizeof(WCHAR))-1] = _T('\0'); + psh.pszCaption = szTitle; + } psh.hwndParent = hwnd; psh.hInstance = hApplet; psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON)); - psh.pszCaption = 0; psh.nPages = 4; psh.nStartPage = 0; psh.ppsp = psp;