From f3370ad46e9f764d37759ff14e126eb173e5e466 Mon Sep 17 00:00:00 2001 From: Don HO Date: Sat, 29 Aug 2020 20:20:54 +0200 Subject: [PATCH] Make Notepad++ invisible on startup while printing and unit-testing The both flags -export=functionList & -quickPrint don't need Notepad++ GUI, so Notepad++ will start up invisiblely while one of these 2 flags is given. It doesn't prevent Notepad++ from being visible in the case of -export=functionList but this PR make unit-tests more bearable. --- PowerEditor/src/Notepad_plus_Window.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index b72ee7ae..8d663ecb 100644 --- a/PowerEditor/src/Notepad_plus_Window.cpp +++ b/PowerEditor/src/Notepad_plus_Window.cpp @@ -172,7 +172,11 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin if (nppGUI._rememberLastSession && !cmdLineParams->_isNoSession) _notepad_plus_plus_core.loadLastSession(); - if (not cmdLineParams->_isPreLaunch) + if (nppParams.doFunctionListExport() || nppParams.doPrintAndExit()) + { + ::ShowWindow(_hSelf, SW_HIDE); + } + else if (not cmdLineParams->_isPreLaunch) { if (cmdLineParams->isPointValid()) ::ShowWindow(_hSelf, SW_SHOW); @@ -184,7 +188,6 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin _notepad_plus_plus_core._pTrayIco = new trayIconControler(_hSelf, IDI_M30ICON, IDC_MINIMIZED_TRAY, ::LoadIcon(_hInst, MAKEINTRESOURCE(IDI_M30ICON)), TEXT("")); _notepad_plus_plus_core._pTrayIco->doTrayIcon(ADD); } - std::vector fileNames; std::vector patterns; patterns.push_back(TEXT("*.xml"));