Fix the restoring problem from system tray when running in admin mode (closes #884)

It seems the notification area is locked (for the sake of security)
while application is in Admin mode.
Disabling the tray icon mode while Notepad++ is in Admin mode is the
compromised solution.
This commit is contained in:
Don Ho 2015-09-11 01:34:28 +02:00
parent 2854de22ec
commit 44e9a03101

View File

@ -1633,7 +1633,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
case WM_SYSCOMMAND:
{
NppGUI & nppgui = (NppGUI &)(pNppParam->getNppGUI());
if ((nppgui._isMinimizedToTray || _pPublicInterface->isPrelaunch()) && (wParam == SC_MINIMIZE))
if (((nppgui._isMinimizedToTray && !_isAdministrator) || _pPublicInterface->isPrelaunch()) && (wParam == SC_MINIMIZE))
{
if (nullptr == _pTrayIco)
_pTrayIco = new trayIconControler(hwnd, IDI_M30ICON, IDC_MINIMIZED_TRAY, ::LoadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(IDI_M30ICON)), TEXT(""));