diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index 44944da32..ba6b00cc9 100644 --- a/PowerEditor/src/Notepad_plus_Window.cpp +++ b/PowerEditor/src/Notepad_plus_Window.cpp @@ -117,6 +117,10 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin ::SendMessage(_hSelf, NPPM_HIDETABBAR, 0, TRUE); } + if (cmdLineParams->_alwaysOnTop) + { + ::SendMessage(_hSelf, WM_COMMAND, IDM_VIEW_ALWAYSONTOP, 0); + } _notepad_plus_plus_core._rememberThisSession = !cmdLineParams->_isNoSession; if (nppGUI._rememberLastSession && !cmdLineParams->_isNoSession) { diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index de70189d1..40414156f 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -151,6 +151,7 @@ struct CmdLineParams { bool _isNoTab; bool _isPreLaunch; bool _showLoadingTime; + bool _alwaysOnTop; int _line2go; int _column2go; diff --git a/PowerEditor/src/winmain.cpp b/PowerEditor/src/winmain.cpp index e7e18bdf8..c6b9d643d 100644 --- a/PowerEditor/src/winmain.cpp +++ b/PowerEditor/src/winmain.cpp @@ -153,6 +153,7 @@ const TCHAR FLAG_NOTABBAR[] = TEXT("-notabbar"); const TCHAR FLAG_SYSTRAY[] = TEXT("-systemtray"); const TCHAR FLAG_LOADINGTIME[] = TEXT("-loadingTime"); const TCHAR FLAG_HELP[] = TEXT("--help"); +const TCHAR FLAG_ALWAYS_ON_TOP[] = TEXT("-alwaysOnTop"); const TCHAR COMMAND_ARG_HELP[] = TEXT("Usage :\r\ \r\ @@ -171,6 +172,7 @@ notepad++ [--help] [-multiInst] [-noPlugins] [-lLanguage] [-nLineNumber] [-cColu -ro : Launch Notepad++ and make the file to open read only\r\ -systemtray : Launch Notepad++ directly in system tray\r\ -loadingTime : Display Notepad++ loading time\r\ + -alwaysOnTop : Make Notepad++ always on top\r\ fullFilePathName : file name to open (absolute or relative path name)\r\ "); @@ -200,6 +202,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int) cmdLineParams._isReadOnly = isInList(FLAG_READONLY, params); cmdLineParams._isNoSession = isInList(FLAG_NOSESSION, params); cmdLineParams._isPreLaunch = isInList(FLAG_SYSTRAY, params); + cmdLineParams._alwaysOnTop = isInList(FLAG_ALWAYS_ON_TOP, params); cmdLineParams._showLoadingTime = isInList(FLAG_LOADINGTIME, params); cmdLineParams._langType = getLangTypeFromParam(params); cmdLineParams._line2go = getNumberFromParam('n', params, isParamePresent);