+ add: textual (T) "Always On Top" indicator in title-bar

This commit is contained in:
Rainer Kottenhoff 2019-05-15 18:36:47 +02:00
parent 9a36c34e56
commit 2caef47609
3 changed files with 14 additions and 9 deletions

View File

@ -3455,14 +3455,16 @@ void DialogAdminExe(HWND hwnd, bool bExecInstaller)
//
bool bFreezeAppTitle = false;
static const WCHAR *pszSep = L" - ";
static const WCHAR *pszMod = L"* ";
const WCHAR* const pszSep = L" - ";
const WCHAR* const pszMod = L"* ";
const WCHAR* const pszPin = L"(T) ";
static WCHAR szCachedFile[MAX_PATH] = { L'\0' };
static WCHAR szCachedDisplayName[MAX_PATH] = { L'\0' };
static WCHAR szAdditionalTitleInfo[MAX_PATH] = { L'\0' };
bool SetWindowTitle(HWND hwnd, UINT uIDAppName, bool bIsElevated, UINT uIDUntitled,
LPCWSTR lpszFile, int iFormat, bool bModified,
LPCWSTR lpszFile, int iFormat, bool bModified, bool bAlwaysOnTop,
UINT uIDReadOnly, bool bReadOnly, LPCWSTR lpszExcerpt)
{
if (bFreezeAppTitle)
@ -3482,10 +3484,12 @@ bool SetWindowTitle(HWND hwnd, UINT uIDAppName, bool bIsElevated, UINT uIDUntitl
WCHAR szTitle[MIDSZ_BUFFER] = { L'\0' };
if (bModified)
StringCchCopy(szTitle, COUNTOF(szTitle), pszMod);
else
StringCchCopy(szTitle, COUNTOF(szTitle), L"");
if (bAlwaysOnTop) {
StringCchCat(szTitle, COUNTOF(szTitle), pszPin);
}
if (bModified) {
StringCchCat(szTitle, COUNTOF(szTitle), pszMod);
}
if (StrIsNotEmpty(lpszExcerpt)) {
WCHAR szExcrptFmt[32] = { L'\0' };

View File

@ -52,7 +52,8 @@ int MessageBoxLng(UINT uType, UINT uIdMsg, ...);
INT_PTR InfoBoxLng(UINT uType, LPCWSTR lpstrSetting, UINT uidMessage, ...);
DWORD GetLastErrorToMsgBox(LPWSTR lpszFunction, DWORD dwErrID);
bool SetWindowTitle(HWND hwnd, UINT uIDAppName, bool, UINT uIDUntitled, LPCWSTR lpszFile, int iFormat, bool, UINT uIDReadOnly, bool, LPCWSTR lpszExcerpt);
bool SetWindowTitle(HWND hwnd, UINT uIDAppName, bool, UINT uIDUntitled, LPCWSTR lpszFile, int iFormat,
bool bModified, bool bAlwaysOnTop, UINT uIDReadOnly, bool bReadOnly, LPCWSTR lpszExcerpt);
void SetAdditionalTitleInfo(LPCWSTR lpszAddTitleInfo);
void SetWindowTransparentMode(HWND hwnd, bool bTransparentMode, int iOpacityLevel);
void CenterDlgInParent(HWND hDlg);

View File

@ -8474,7 +8474,7 @@ void UpdateToolbar()
static void _UpdateToolbarDelayed()
{
SetWindowTitle(Globals.hwndMain, s_uidsAppTitle, s_bIsElevated, IDS_MUI_UNTITLED, Globals.CurrentFile,
Settings.PathNameFormat, IsSaveNeeded(ISN_GET),
Settings.PathNameFormat, IsSaveNeeded(ISN_GET), Settings.AlwaysOnTop,
IDS_MUI_READONLY, s_bFileReadOnly, s_wchTitleExcerpt);
if (!Settings.ShowToolbar) { return; }