mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
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
This commit is contained in:
parent
5fb69fcf60
commit
71cf45cfa3
1 changed files with 11 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue