Browse Source

GUI shows application title when run outside of Explorer

pull/51/head
Valentin Radu 4 years ago
parent
commit
a01f110341
  1. 29
      ExplorerPatcher/GUI.c
  2. 2
      ExplorerPatcher/GUI.h
  3. 2
      ExplorerPatcher/settings.reg

29
ExplorerPatcher/GUI.c

@ -182,6 +182,31 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) @@ -182,6 +182,31 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
);
if (!strncmp(line, ";M ", 3))
{
TCHAR exeName[MAX_PATH + 1];
GetProcessImageFileNameW(
OpenProcess(
PROCESS_QUERY_INFORMATION,
FALSE,
GetCurrentProcessId()
),
exeName,
MAX_PATH
);
PathStripPath(exeName);
if (wcscmp(exeName, L"explorer.exe"))
{
LoadStringW(hModule, IDS_PRODUCTNAME, text, MAX_LINE_LENGTH);
}
else
{
LoadStringW(GetModuleHandleW(L"ExplorerFrame.dll"), 50222, text, 260);
wchar_t* p = wcschr(text, L'(');
if (p)
{
p--;
*p = 0;
}
}
rcText.bottom += GUI_CAPTION_LINE_HEIGHT - dwLineHeight;
dwLineHeight = GUI_CAPTION_LINE_HEIGHT;
_this->extent.cyTopHeight = rcText.bottom;
@ -900,6 +925,10 @@ __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLin @@ -900,6 +925,10 @@ __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLin
TCHAR title[260];
LoadStringW(GetModuleHandleW(L"ExplorerFrame.dll"), 726, title, 260);
if (title[0] == 0)
{
LoadStringW(hModule, IDS_PRODUCTNAME, title, 260);
}
HWND hwnd = CreateWindowEx(
NULL,

2
ExplorerPatcher/GUI.h

@ -5,6 +5,8 @@ name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \ @@ -5,6 +5,8 @@ name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#include <Windows.h>
#pragma comment(lib, "Version.lib")
#include <Shlwapi.h>
#pragma comment(lib, "Shlwapi.lib")
#include <windowsx.h>
#include <tlhelp32.h>
#include <shellscalingapi.h>

2
ExplorerPatcher/settings.reg

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Windows Registry Editor Version 5.00
;M Properties
;M Settings
;T Shell
;l Enable missing system tray icons

Loading…
Cancel
Save