From 894c4dcffdb5392eda4c6371b00748227bfc62ae Mon Sep 17 00:00:00 2001 From: donho Date: Wed, 22 Aug 2007 23:10:45 +0000 Subject: [PATCH] [NEW_FEATURE] Add new plugin notification message NPPN_FILEJUSTOPENED. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@12 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h | 5 ++++- PowerEditor/src/Notepad_plus.cpp | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index 57838cd3..840cae54 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -206,7 +206,10 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = 0; - + #define NPPN_FILEJUSTOPENED (NPPN_FIRST + 4) // To notify plugins that the current file is just opened + //scnNotification->nmhdr.code = NPPN_FILEJUSTOPENED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = 0; diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 60d18d2d..ac6ca604 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -472,6 +472,14 @@ bool Notepad_plus::doOpen(const char *fileName, bool isReadOnly) _linkTriggered = true; _isDocModifing = false; setWorkingDir(longFileName); + + // Notify plugins that current file is just opened + SCNotification scnN; + scnN.nmhdr.code = NPPN_FILEJUSTOPENED; + scnN.nmhdr.hwndFrom = _hSelf; + scnN.nmhdr.idFrom = 0; + _pluginsManager.notify(&scnN); + return true; } else