CSSExplorer plug-in allows easy navigation and edit of CSS files with Notepad++.
CSSExplorer plug-in has two main components:
Notepad++ plugin system is based on Windows Message System. In our plug-in all the messages from Notepad++ are sent to Adapter Component, and the Adapter Component pass relevant data to C# Component. C# Component can send messages directly to Notepad++. It can also send messages to the C++ adapter.
Developing UI, for the plug-in, in C# language was one of the challenges in the project. Since we wrote our project in C# language, and Notepad++ was written in C++ language with pure Win32 API (without MFC), the integration of the C# window in Notepad++ was not so easy.
.NET plugin for Notepad++ - How?
Our solution is based
on exposing C# control to COM. We created UserControl project in C# and exposed
it to COM as ActiveX control. Some of the ideas were taken from Morgan
Skinner's article on CodeProject. C++ component of the project has dialog
window that act in our project as a container of C# control. Notepad++ was
developed without MFC with pure Win32 API, therefore to integrate ActiveX
control we used Active Template Library (ATL).
We wrote detailed article on CodeProject that describes how we succeeded to integrate our .NET plug-in in Windows that build with pure Win32 API. We hope that this article will help others to develop combined C# & C++ projects.
Link to the article: http://www.codeproject.com/KB/cs/DotNetActiveX.aspx
CSSExplorer Adapter Design
CSSExplorerAdapter – this is the start-up class, it initialize CSSExplorer Dialog and WebBrowser Dialog. It also provides information about the plug-in to Notepad++.
ATLContainerDlg – This is the parent class for CSSExplorerDlg and WebBrowserDlg, It responsible to display ActiveX control that was requested from the child. CSSExplorerDlg request C# ActiveX control and WebBrowserDlg request WebBrowser ActiveX control.
CSSExplorerDlg – This is the container for C# ActiveX control
WebBrowserDlg – This is the container for WebBrowser ActiveX control