MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / SetNotifyIconTitle

Function SetNotifyIconTitle

src/Notepad2.c:6211–6238  ·  view source on GitHub ↗

============================================================================= SetNotifyIconTitle()

Source from the content-addressed store, hash-verified

6209//
6210//
6211void SetNotifyIconTitle ( HWND hwnd )
6212{
6213 NOTIFYICONDATA nid;
6214 SHFILEINFO shfi;
6215 WCHAR tchTitle[128];
6216 WCHAR tchFormat[32];
6217 ZeroMemory ( &nid, sizeof ( NOTIFYICONDATA ) );
6218 nid.cbSize = sizeof ( NOTIFYICONDATA );
6219 nid.hWnd = hwnd;
6220 nid.uID = 0;
6221 nid.uFlags = NIF_TIP;
6222 if ( lstrlen ( szTitleExcerpt ) ) {
6223 GetString ( IDS_TITLEEXCERPT, tchFormat, COUNTOF ( tchFormat ) );
6224 wsprintf ( tchTitle, tchFormat, szTitleExcerpt );
6225 } else if ( lstrlen ( szCurFile ) ) {
6226 SHGetFileInfo2 ( szCurFile, 0, &shfi, sizeof ( SHFILEINFO ), SHGFI_DISPLAYNAME );
6227 PathCompactPathEx ( tchTitle, shfi.szDisplayName, COUNTOF ( tchTitle ) - 4, 0 );
6228 } else {
6229 GetString ( IDS_UNTITLED, tchTitle, COUNTOF ( tchTitle ) - 4 );
6230 }
6231 if ( bModified || iEncoding != iOriginalEncoding ) {
6232 lstrcpy ( nid.szTip, L"* " );
6233 } else {
6234 lstrcpy ( nid.szTip, L"" );
6235 }
6236 lstrcat ( nid.szTip, tchTitle );
6237 Shell_NotifyIcon ( NIM_MODIFY, &nid );
6238}
6239//=============================================================================
6240//
6241// InstallFileWatching()

Callers 2

InitInstanceFunction · 0.85
MainWndProcFunction · 0.85

Calls 1

SHGetFileInfo2Function · 0.85

Tested by

no test coverage detected