Browse Source

First commit

Coder 8 months ago
commit
98bf735982
28 changed files with 15322 additions and 0 deletions
  1. 333 0
      .gitignore
  2. 509 0
      DllExport.bat
  3. 31 0
      NppChnConv.sln
  4. 70 0
      NppChnConvPlugin/AnyCpuBridgeMain.cs
  5. 30 0
      NppChnConvPlugin/AssemblyResolveInMyAround.cs
  6. 59 0
      NppChnConvPlugin/ManagedExportsBridge.cs
  7. 159 0
      NppChnConvPlugin/NppChnConvPlugin.csproj
  8. 69 0
      NppChnConvPlugin/NppPluginInfrastructure/ClikeStringArray.cs
  9. 71 0
      NppChnConvPlugin/NppPluginInfrastructure/Docking_h.cs
  10. 273 0
      NppChnConvPlugin/NppPluginInfrastructure/GatewayDomain.cs
  11. 2591 0
      NppChnConvPlugin/NppPluginInfrastructure/IScintillaGateway.cs
  12. 398 0
      NppChnConvPlugin/NppPluginInfrastructure/MenuCmdID_h.cs
  13. 764 0
      NppChnConvPlugin/NppPluginInfrastructure/Msgs_h.cs
  14. 100 0
      NppChnConvPlugin/NppPluginInfrastructure/NotepadPPGateway.cs
  15. 52 0
      NppChnConvPlugin/NppPluginInfrastructure/NppPluginNETBase.cs
  16. 192 0
      NppChnConvPlugin/NppPluginInfrastructure/NppPluginNETHelper.cs
  17. 306 0
      NppChnConvPlugin/NppPluginInfrastructure/Preference_h.cs
  18. 345 0
      NppChnConvPlugin/NppPluginInfrastructure/Resource_h.cs
  19. 5217 0
      NppChnConvPlugin/NppPluginInfrastructure/ScintillaGateway.cs
  20. 3047 0
      NppChnConvPlugin/NppPluginInfrastructure/Scintilla_iface.cs
  21. 317 0
      NppChnConvPlugin/NppPluginInfrastructure/Win32.cs
  22. 88 0
      NppChnConvPlugin/PluginBridge.cs
  23. 36 0
      NppChnConvPlugin/Properties/AssemblyInfo.cs
  24. 83 0
      NppChnConvPlugin/Properties/Resources.Designer.cs
  25. 127 0
      NppChnConvPlugin/Properties/Resources.resx
  26. BIN
      NppChnConvPlugin/Resources/Bitmap1.bmp
  27. BIN
      NppChnConvPlugin/Resources/Bitmap2.bmp
  28. 55 0
      NppChnConvPlugin/UnmanagedExportsStubsToBridge.cs

+ 333 - 0
.gitignore

@@ -0,0 +1,333 @@
+# ---> VisualStudio
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# No Version Control Files
+CefSharpWrap.AceEditorWrap/Resources/AceMinNoconflict/
+
+# Build results
+WholeBin/
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+build/
+bld/
+[Bb]in/
+[Oo]bj/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+*.cachefile
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings 
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+
+# Windows Azure Build Output
+csx/
+*.build.csdef
+
+# Windows Store app package directory
+AppPackages/
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+[Ss]tyle[Cc]op.*
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# ---> C Sharp
+# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
+[Bb]in/
+[Oo]bj/
+
+# mstest test results
+TestResults
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+[Dd]ebug/
+[Rr]elease/
+x64/
+*_i.c
+*_p.c
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.log
+*.vspscc
+*.vssscc
+.builds
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*
+
+# NCrunch
+*.ncrunch*
+.*crunch*.local.xml
+
+# Installshield output folder
+[Ee]xpress
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish
+
+# Publish Web Output
+*.Publish.xml
+
+# NuGet Packages Directory
+packages
+
+# Windows Azure Build Output
+csx
+*.build.csdef
+
+# Windows Store app package directory
+AppPackages/
+
+# Others
+[Bb]in
+[Oo]bj
+sql
+TestResults
+[Tt]est[Rr]esult*
+*.Cache
+ClientBin
+[Ss]tyle[Cc]op.*
+~$*
+*.dbmdl
+Generated_Code #added for RIA/Silverlight projects
+
+# Backup & report files from converting an old project file to a newer
+# Visual Studio version. Backup files are not needed, because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+

File diff suppressed because it is too large
+ 509 - 0
DllExport.bat


+ 31 - 0
NppChnConv.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.8.34004.107
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NppChnConvPlugin", "NppChnConvPlugin\NppChnConvPlugin.csproj", "{4A0D912B-8BC8-4F80-9A5C-682B4E0B9E91}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
+		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{4A0D912B-8BC8-4F80-9A5C-682B4E0B9E91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{4A0D912B-8BC8-4F80-9A5C-682B4E0B9E91}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{4A0D912B-8BC8-4F80-9A5C-682B4E0B9E91}.Debug|x64.ActiveCfg = Debug|x64
+		{4A0D912B-8BC8-4F80-9A5C-682B4E0B9E91}.Debug|x64.Build.0 = Debug|x64
+		{4A0D912B-8BC8-4F80-9A5C-682B4E0B9E91}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{4A0D912B-8BC8-4F80-9A5C-682B4E0B9E91}.Release|Any CPU.Build.0 = Release|Any CPU
+		{4A0D912B-8BC8-4F80-9A5C-682B4E0B9E91}.Release|x64.ActiveCfg = Release|x64
+		{4A0D912B-8BC8-4F80-9A5C-682B4E0B9E91}.Release|x64.Build.0 = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {64C1F8B2-6D40-4F93-A943-E1E2B8137EA8}
+	EndGlobalSection
+EndGlobal

+ 70 - 0
NppChnConvPlugin/AnyCpuBridgeMain.cs

@@ -0,0 +1,70 @@
+using System;
+using System.Diagnostics;
+using System.Reflection;
+using NppChnConvPlugin.NppPluginInfrastructure;
+
+namespace NppChnConvPlugin
+{
+    public static class AnyCpuBridgeMain
+    {
+        static AnyCpuBridgeMain()
+        {
+            try
+            {
+                InitReferenceAssembly();
+            }
+            catch (Exception exception)
+            {
+                System.Windows.Forms.MessageBox.Show($"Plugin init fail:{PluginName},{exception}");
+                throw;
+            }
+        }
+
+        private static void InitReferenceAssembly()
+        {
+
+        }
+
+        public static readonly string PluginName = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductName;
+
+        public static void CommandMenuInit()
+        {
+            PluginBridge.SetupPluginMenu();
+        }
+
+        public static void SetToolBarIcon()
+        {
+            PluginBridge.SetupToolBarIcon();
+        }
+
+        public static void OnNotification(ScNotification notification)
+        {
+            if (false == PluginBridge.Enable) return;
+
+            //Check for updates
+            if (notification.Header.Code == (uint)SciMsg.SCN_UPDATEUI)
+            {
+                //Update the view
+                if (0 != (notification.Updated & (uint)SciMsg.SC_UPDATE_V_SCROLL)) PluginBridge.UpdateScroll();
+            }
+            else if (notification.Header.Code == (uint)NppMsg.NPPN_BUFFERACTIVATED)
+            {
+                //Update the scintilla handle in all cases to keep track of which instance is active
+                PluginBridge.FlushState();
+                PluginBridge.UpdateText();
+                PluginBridge.UpdateScroll();
+            }
+            else if (notification.Header.Code == (uint)SciMsg.SCN_MODIFIED
+                     && (notification.ModificationType & ((uint)SciMsg.SC_MOD_INSERTTEXT | (uint)SciMsg.SC_MOD_DELETETEXT)) != 0)
+            {
+                //Track if any text modifications have been made
+                PluginBridge.UpdateText();
+            }
+        }
+
+        public static void PluginCleanUp()
+        {
+            PluginBridge.Exit();
+        }
+    }
+}

+ 30 - 0
NppChnConvPlugin/AssemblyResolveInMyAround.cs

@@ -0,0 +1,30 @@
+using System;
+using System.IO;
+using System.Reflection;
+
+namespace NppChnConvPlugin
+{
+    internal static class AssemblyResolveInMyAround
+    {
+        /// <summary>
+        /// Patch assembly version range
+        /// </summary>
+        public static void Register()
+        {
+            var executingAssemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new InvalidOperationException("Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) is null");
+
+            AppDomain.CurrentDomain.AssemblyResolve += delegate (object sender, ResolveEventArgs args)
+            {
+                var pathWithoutExtension = Path.Combine(executingAssemblyDir, new AssemblyName(args.Name).Name);
+
+                var asmPath = pathWithoutExtension + ".dll";
+                if (File.Exists(asmPath)) return Assembly.LoadFrom(asmPath);
+
+                asmPath = pathWithoutExtension + ".exe";
+                if (File.Exists(asmPath)) return Assembly.LoadFrom(asmPath);
+
+                return null;
+            };
+        }
+    }
+}

+ 59 - 0
NppChnConvPlugin/ManagedExportsBridge.cs

@@ -0,0 +1,59 @@
+using System;
+using System.Runtime.InteropServices;
+using NppChnConvPlugin.NppPluginInfrastructure;
+
+namespace NppChnConvPlugin
+{
+    public class ManagedExportsBridge
+    {
+        private static IntPtr PtrPluginName = IntPtr.Zero;
+
+        public static bool IsUnicode()
+        {
+            return true;
+        }
+
+        public static void SetInfo(NppData notepadPlusData)
+        {
+            PluginBase.nppData = notepadPlusData;
+            AnyCpuBridgeMain.CommandMenuInit();
+        }
+
+        public static IntPtr GetFuncsArray(ref int nbF)
+        {
+            nbF = PluginBase._funcItems.Items.Count;
+            return PluginBase._funcItems.NativePointer;
+        }
+
+        public static uint MessageProc(uint message, IntPtr wParam, IntPtr lParam)
+        {
+            return 1;
+        }
+
+        public static IntPtr GetName()
+        {
+            if (PtrPluginName == IntPtr.Zero)
+                PtrPluginName = Marshal.StringToHGlobalUni(AnyCpuBridgeMain.PluginName);
+            return PtrPluginName;
+        }
+
+        public static void BeNotified(IntPtr notifyCode)
+        {
+            var notification = (ScNotification)Marshal.PtrToStructure(notifyCode, typeof(ScNotification));
+            if (notification.Header.Code == (uint)NppMsg.NPPN_TBMODIFICATION)
+            {
+                PluginBase._funcItems.RefreshItems();
+                AnyCpuBridgeMain.SetToolBarIcon();
+            }
+            else if (notification.Header.Code == (uint)NppMsg.NPPN_SHUTDOWN)
+            {
+                AnyCpuBridgeMain.PluginCleanUp();
+                Marshal.FreeHGlobal(PtrPluginName);
+            }
+            else
+            {
+                AnyCpuBridgeMain.OnNotification(notification);
+            }
+        }
+    }
+}

+ 159 - 0
NppChnConvPlugin/NppChnConvPlugin.csproj

@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{4A0D912B-8BC8-4F80-9A5C-682B4E0B9E91}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>NppChnConvPlugin</RootNamespace>
+    <AssemblyName>NppChnConvPlugin</AssemblyName>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <PlatformTarget>x64</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <PlatformTarget>x64</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup>
+    <DllExportIdent>126A758D-E3AD-4DA4-A12D-4D34E03CC040</DllExportIdent>
+    <DllExportMetaLibName>DllExport.dll</DllExportMetaLibName>
+    <DllExportNamespace>NppChnConvPlugin</DllExportNamespace>
+    <DllExportDDNSCecil>true</DllExportDDNSCecil>
+    <DllExportSkipOnAnyCpu>false</DllExportSkipOnAnyCpu>
+    <DllExportPlatform>Auto</DllExportPlatform>
+    <DllExportOrdinalsBase>1</DllExportOrdinalsBase>
+    <DllExportGenExpLib>false</DllExportGenExpLib>
+    <DllExportOurILAsm>false</DllExportOurILAsm>
+    <DllExportSysObjRebase>false</DllExportSysObjRebase>
+    <DllExportLeaveIntermediateFiles>false</DllExportLeaveIntermediateFiles>
+    <DllExportTimeout>30000</DllExportTimeout>
+    <DllExportPeCheck>2</DllExportPeCheck>
+    <DllExportPatches>0</DllExportPatches>
+    <DllExportPreProcType>0</DllExportPreProcType>
+    <DllExportPostProcType>0</DllExportPostProcType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="AnyCpuBridgeMain.cs" />
+    <Compile Include="AssemblyResolveInMyAround.cs" />
+    <Compile Include="ManagedExportsBridge.cs" />
+    <Compile Include="NppPluginInfrastructure\ClikeStringArray.cs" />
+    <Compile Include="NppPluginInfrastructure\Docking_h.cs" />
+    <Compile Include="NppPluginInfrastructure\GatewayDomain.cs" />
+    <Compile Include="NppPluginInfrastructure\IScintillaGateway.cs" />
+    <Compile Include="NppPluginInfrastructure\MenuCmdID_h.cs" />
+    <Compile Include="NppPluginInfrastructure\Msgs_h.cs" />
+    <Compile Include="NppPluginInfrastructure\NotepadPPGateway.cs" />
+    <Compile Include="NppPluginInfrastructure\NppPluginNETBase.cs" />
+    <Compile Include="NppPluginInfrastructure\NppPluginNETHelper.cs" />
+    <Compile Include="NppPluginInfrastructure\Preference_h.cs" />
+    <Compile Include="NppPluginInfrastructure\Resource_h.cs" />
+    <Compile Include="NppPluginInfrastructure\ScintillaGateway.cs" />
+    <Compile Include="NppPluginInfrastructure\Scintilla_iface.cs" />
+    <Compile Include="NppPluginInfrastructure\Win32.cs" />
+    <Compile Include="PluginBridge.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Compile Include="UnmanagedExportsStubsToBridge.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="CHTCHSConv">
+      <Version>1.0.0</Version>
+    </PackageReference>
+    <PackageReference Include="DllExport">
+      <Version>1.7.4</Version>
+      <Visible>false</Visible>
+      <Wz>1</Wz>
+    </PackageReference>
+    <PackageReference Include="ilmerge">
+      <Version>3.0.29</Version>
+    </PackageReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Resources\Bitmap1.bmp" />
+    <Content Include="Resources\Bitmap2.bmp" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup />
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <ImportGroup Label=".NET DllExport">
+    <Import Project="$(SolutionDir)packages\DllExport.1.7.4\tools\net.r_eg.DllExport.targets" Condition="Exists($([MSBuild]::Escape('$(SolutionDir)packages\DllExport.1.7.4\tools\net.r_eg.DllExport.targets')))" Label="8337224c9ad9e356" />
+  </ImportGroup>
+  <Target Name="DllExportRestorePkg" BeforeTargets="PrepareForBuild">
+    <Error Condition="!Exists('$(SolutionDir)DllExport.bat')" Text="DllExport.bat is not found. Path: '$(SolutionDir)' - https://github.com/3F/DllExport" />
+    <Exec Condition="('$(DllExportModImported)' != 'true' Or !Exists('$(SolutionDir)packages\DllExport.1.7.4\tools\net.r_eg.DllExport.targets')) And Exists('$(SolutionDir)DllExport.bat')" Command=".\DllExport.bat  -action Restore" WorkingDirectory="$(SolutionDir)" />
+    <MSBuild Condition="'$(DllExportModImported)' != 'true'" Projects="$(SolutionDir)packages\DllExport.1.7.4\tools\net.r_eg.DllExport.targets" Targets="DllExportMetaXBaseTarget" Properties="TargetFramework=$(TargetFramework)">
+      <Output TaskParameter="TargetOutputs" PropertyName="DllExportMetaXBase" />
+    </MSBuild>
+    <ItemGroup>
+      <Reference Include="DllExport, PublicKeyToken=8337224c9ad9e356">
+        <HintPath>$(SolutionDir)packages\DllExport.1.7.4\gcache\$(DllExportMetaXBase)\$(DllExportNamespace)\$(DllExportMetaLibName)</HintPath>
+        <Private>False</Private>
+        <SpecificVersion>False</SpecificVersion>
+      </Reference>
+    </ItemGroup>
+  </Target>
+  <Target Name="DllExportRPkgDynamicImport" BeforeTargets="PostBuildEvent" DependsOnTargets="GetFrameworkPaths" Condition="'$(DllExportModImported)' != 'true' And '$(DllExportRPkgDyn)' != 'false'">
+    <MSBuild BuildInParallel="true" UseResultsCache="true" Projects="$(MSBuildProjectFullPath)" Properties="DllExportRPkgDyn=true" Targets="Build" />
+  </Target>
+</Project>

+ 69 - 0
NppChnConvPlugin/NppPluginInfrastructure/ClikeStringArray.cs

@@ -0,0 +1,69 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+    public class ClikeStringArray : IDisposable
+    {
+        IntPtr _nativeArray;
+        List<IntPtr> _nativeItems;
+        bool _disposed = false;
+
+        public ClikeStringArray(int num, int stringCapacity)
+        {
+            _nativeArray = Marshal.AllocHGlobal((num + 1) * IntPtr.Size);
+            _nativeItems = new List<IntPtr>();
+            for (int i = 0; i < num; i++)
+            {
+                IntPtr item = Marshal.AllocHGlobal(stringCapacity);
+                Marshal.WriteIntPtr((IntPtr)((int)_nativeArray + (i * IntPtr.Size)), item);
+                _nativeItems.Add(item);
+            }
+            Marshal.WriteIntPtr((IntPtr)((int)_nativeArray + (num * IntPtr.Size)), IntPtr.Zero);
+        }
+        public ClikeStringArray(List<string> lstStrings)
+        {
+            _nativeArray = Marshal.AllocHGlobal((lstStrings.Count + 1) * IntPtr.Size);
+            _nativeItems = new List<IntPtr>();
+            for (int i = 0; i < lstStrings.Count; i++)
+            {
+                IntPtr item = Marshal.StringToHGlobalUni(lstStrings[i]);
+                Marshal.WriteIntPtr((IntPtr)((int)_nativeArray + (i * IntPtr.Size)), item);
+                _nativeItems.Add(item);
+            }
+            Marshal.WriteIntPtr((IntPtr)((int)_nativeArray + (lstStrings.Count * IntPtr.Size)), IntPtr.Zero);
+        }
+
+        public IntPtr NativePointer { get { return _nativeArray; } }
+        public List<string> ManagedStringsAnsi { get { return _getManagedItems(false); } }
+        public List<string> ManagedStringsUnicode { get { return _getManagedItems(true); } }
+        List<string> _getManagedItems(bool unicode)
+        {
+            List<string> _managedItems = new List<string>();
+            for (int i = 0; i < _nativeItems.Count; i++)
+            {
+                if (unicode) _managedItems.Add(Marshal.PtrToStringUni(_nativeItems[i]));
+                else _managedItems.Add(Marshal.PtrToStringAnsi(_nativeItems[i]));
+            }
+            return _managedItems;
+        }
+
+        public void Dispose()
+        {
+            if (!_disposed)
+            {
+                for (int i = 0; i < _nativeItems.Count; i++)
+                    if (_nativeItems[i] != IntPtr.Zero) Marshal.FreeHGlobal(_nativeItems[i]);
+                if (_nativeArray != IntPtr.Zero) Marshal.FreeHGlobal(_nativeArray);
+                _disposed = true;
+            }
+        }
+        ~ClikeStringArray()
+        {
+            Dispose();
+        }
+    }
+}

+ 71 - 0
NppChnConvPlugin/NppPluginInfrastructure/Docking_h.cs

@@ -0,0 +1,71 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+//
+// This file should stay in sync with the CPP project file
+// "notepad-plus-plus/PowerEditor/src/WinControls/DockingWnd/Docking.h"
+// found at
+// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/WinControls/DockingWnd/Docking.h
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+
+    [Flags]
+    public enum NppTbMsg : uint
+    {
+        // styles for containers
+        //CAPTION_TOP                = 1,
+        //CAPTION_BOTTOM            = 0,
+
+        // defines for docking manager
+        CONT_LEFT = 0,
+        CONT_RIGHT = 1,
+        CONT_TOP = 2,
+        CONT_BOTTOM = 3,
+        DOCKCONT_MAX = 4,
+
+        // mask params for plugins of internal dialogs
+        DWS_ICONTAB = 0x00000001,            // Icon for tabs are available
+        DWS_ICONBAR = 0x00000002,            // Icon for icon bar are available (currently not supported)
+        DWS_ADDINFO = 0x00000004,            // Additional information are in use
+        DWS_PARAMSALL = (DWS_ICONTAB | DWS_ICONBAR | DWS_ADDINFO),
+
+        // default docking values for first call of plugin
+        DWS_DF_CONT_LEFT = (CONT_LEFT << 28),    // default docking on left
+        DWS_DF_CONT_RIGHT = (CONT_RIGHT << 28),    // default docking on right
+        DWS_DF_CONT_TOP = (CONT_TOP << 28),        // default docking on top
+        DWS_DF_CONT_BOTTOM = (CONT_BOTTOM << 28),    // default docking on bottom
+        DWS_DF_FLOATING = 0x80000000            // default state is floating
+    }
+
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+    public struct NppTbData
+    {
+        public IntPtr hClient;            // HWND: client Window Handle
+        public string pszName;            // TCHAR*: name of plugin (shown in window)
+        public int dlgID;                // int: a funcItem provides the function pointer to start a dialog. Please parse here these ID
+                                         // user modifications
+        public NppTbMsg uMask;                // UINT: mask params: look to above defines
+        public uint hIconTab;            // HICON: icon for tabs
+        public string pszAddInfo;        // TCHAR*: for plugin to display additional informations
+                                         // internal data, do not use !!!
+        public RECT rcFloat;            // RECT: floating position
+        public int iPrevCont;           // int: stores the privious container (toggling between float and dock)
+        public string pszModuleName;    // const TCHAR*: it's the plugin file name. It's used to identify the plugin
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    public struct RECT
+    {
+        public RECT(int left, int top, int right, int bottom)
+        {
+            Left = left; Top = top; Right = right; Bottom = bottom;
+        }
+        public int Left;
+        public int Top;
+        public int Right;
+        public int Bottom;
+    }
+
+}

+ 273 - 0
NppChnConvPlugin/NppPluginInfrastructure/GatewayDomain.cs

@@ -0,0 +1,273 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+    /// <summary>
+    /// Colours are set using the RGB format (Red, Green, Blue). The intensity of each colour is set in the range 0 to 255.
+    /// If you have three such intensities, they are combined as: red | (green &lt;&lt; 8) | (blue &lt;&lt; 16).
+    /// If you set all intensities to 255, the colour is white. If you set all intensities to 0, the colour is black.
+    /// When you set a colour, you are making a request. What you will get depends on the capabilities of the system and the current screen mode.
+    /// </summary>
+    public class Colour
+    {
+        public readonly int Red, Green, Blue;
+
+        public Colour(int rgb)
+		{
+			Red = rgb & 0xFF;
+			Green = (rgb >> 8) & 0xFF;
+			Blue = (rgb >> 16) & 0xFF;
+		}
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="red">a number 0-255</param>
+        /// <param name="green">a number 0-255</param>
+        /// <param name="blue">a number 0-255</param>
+        public Colour(int red, int green, int blue)
+        {
+            if(red > 255 || red < 0)
+                throw new ArgumentOutOfRangeException("red", "must be 0-255");
+            if(green > 255 || green < 0)
+                throw new ArgumentOutOfRangeException("green", "must be 0-255");
+            if(blue > 255 || blue < 0)
+                throw new ArgumentOutOfRangeException("blue", "must be 0-255");
+            Red = red;
+            Green = green;
+            Blue = blue;
+        }
+
+        public int Value
+        {
+            get { return Red + (Green << 8) + (Blue << 16); }
+        }
+    }
+
+    /// <summary>
+    /// Positions within the Scintilla document refer to a character or the gap before that character.
+    /// The first character in a document is 0, the second 1 and so on. If a document contains nLen characters, the last character is numbered nLen-1. The caret exists between character positions and can be located from before the first character (0) to after the last character (nLen).
+    ///
+    /// There are places where the caret can not go where two character bytes make up one character.
+    /// This occurs when a DBCS character from a language like Japanese is included in the document or when line ends are marked with the CP/M
+    /// standard of a carriage return followed by a line feed.The INVALID_POSITION constant(-1) represents an invalid position within the document.
+    ///
+    /// All lines of text in Scintilla are the same height, and this height is calculated from the largest font in any current style.This restriction
+    /// is for performance; if lines differed in height then calculations involving positioning of text would require the text to be styled first.
+    ///
+    /// If you use messages, there is nothing to stop you setting a position that is in the middle of a CRLF pair, or in the middle of a 2 byte character.
+    /// However, keyboard commands will not move the caret into such positions.
+    /// </summary>
+    public class Position : IEquatable<Position>
+    {
+        private readonly int pos;
+
+        public Position(int pos)
+        {
+            this.pos = pos;
+        }
+
+        public int Value
+        {
+            get { return pos; }
+        }
+
+        public static Position operator +(Position a, Position b)
+        {
+            return new Position(a.pos + b.pos);
+        }
+
+        public static Position operator -(Position a, Position b)
+        {
+            return new Position(a.pos - b.pos);
+        }
+
+        public static bool operator ==(Position a, Position b)
+        {
+	        if (ReferenceEquals(a, b))
+		        return true;
+			if (ReferenceEquals(a, null))
+				return false;
+			if (ReferenceEquals(b, null))
+				return false;
+			return  a.pos == b.pos;
+        }
+
+        public static bool operator !=(Position a, Position b)
+        {
+            return !(a == b);
+        }
+
+        public static bool operator >(Position a, Position b)
+        {
+            return a.Value > b.Value;
+        }
+
+        public static bool operator <(Position a, Position b)
+        {
+            return a.Value < b.Value;
+        }
+
+        public static Position Min(Position a, Position b)
+        {
+            if (a < b)
+                return a;
+            return b;
+        }
+
+		public static Position Max(Position a, Position b)
+		{
+			if (a > b)
+				return a;
+			return b;
+		}
+
+		public override string ToString()
+        {
+            return "Postion: " + pos;
+        }
+
+        public bool Equals(Position other)
+        {
+            if (ReferenceEquals(null, other)) return false;
+            if (ReferenceEquals(this, other)) return true;
+            return pos == other.pos;
+        }
+
+        public override bool Equals(object obj)
+        {
+            if (ReferenceEquals(null, obj)) return false;
+            if (ReferenceEquals(this, obj)) return true;
+            if (obj.GetType() != this.GetType()) return false;
+            return Equals((Position)obj);
+        }
+
+        public override int GetHashCode()
+        {
+            return pos;
+        }
+    }
+
+    /// <summary>
+    /// Class containing key and modifiers
+    ///
+    /// The key code is a visible or control character or a key from the SCK_* enumeration, which contains:
+    /// SCK_ADD, SCK_BACK, SCK_DELETE, SCK_DIVIDE, SCK_DOWN, SCK_END, SCK_ESCAPE, SCK_HOME, SCK_INSERT, SCK_LEFT, SCK_MENU, SCK_NEXT(Page Down), SCK_PRIOR(Page Up), S
+    /// CK_RETURN, SCK_RIGHT, SCK_RWIN, SCK_SUBTRACT, SCK_TAB, SCK_UP, and SCK_WIN.
+    ///
+    /// The modifiers are a combination of zero or more of SCMOD_ALT, SCMOD_CTRL, SCMOD_SHIFT, SCMOD_META, and SCMOD_SUPER.
+    /// On OS X, the Command key is mapped to SCMOD_CTRL and the Control key to SCMOD_META.SCMOD_SUPER is only available on GTK+ which is commonly the Windows key.
+    /// If you are building a table, you might want to use SCMOD_NORM, which has the value 0, to mean no modifiers.
+    /// </summary>
+    public class KeyModifier
+    {
+        private readonly int value;
+
+        /// <summary>
+        /// The key code is a visible or control character or a key from the SCK_* enumeration, which contains:
+        /// SCK_ADD, SCK_BACK, SCK_DELETE, SCK_DIVIDE, SCK_DOWN, SCK_END, SCK_ESCAPE, SCK_HOME, SCK_INSERT, SCK_LEFT, SCK_MENU, SCK_NEXT(Page Down), SCK_PRIOR(Page Up),
+        /// SCK_RETURN, SCK_RIGHT, SCK_RWIN, SCK_SUBTRACT, SCK_TAB, SCK_UP, and SCK_WIN.
+        ///
+        /// The modifiers are a combination of zero or more of SCMOD_ALT, SCMOD_CTRL, SCMOD_SHIFT, SCMOD_META, and SCMOD_SUPER.
+        /// On OS X, the Command key is mapped to SCMOD_CTRL and the Control key to SCMOD_META.SCMOD_SUPER is only available on GTK+ which is commonly the Windows key.
+        /// If you are building a table, you might want to use SCMOD_NORM, which has the value 0, to mean no modifiers.
+        /// </summary>
+        public KeyModifier(SciMsg SCK_KeyCode, SciMsg SCMOD_modifier)
+        {
+            value = (int) SCK_KeyCode | ((int) SCMOD_modifier << 16);
+        }
+
+        public int Value
+        {
+            get { return Value; }
+        }
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    public struct CharacterRange
+    {
+        public CharacterRange(int cpmin, int cpmax) { cpMin = cpmin; cpMax = cpmax; }
+        public int cpMin;
+        public int cpMax;
+    }
+
+    public class Cells
+    {
+        char[] charactersAndStyles;
+
+        public Cells(char[] charactersAndStyles)
+        {
+            this.charactersAndStyles = charactersAndStyles;
+        }
+
+        public char[] Value { get { return charactersAndStyles; } }
+    }
+
+    public class TextRange : IDisposable
+    {
+        Sci_TextRange _sciTextRange;
+        IntPtr _ptrSciTextRange;
+        bool _disposed = false;
+
+        public TextRange(CharacterRange chrRange, int stringCapacity)
+        {
+            _sciTextRange.chrg = chrRange;
+            _sciTextRange.lpstrText = Marshal.AllocHGlobal(stringCapacity);
+        }
+        public TextRange(int cpmin, int cpmax, int stringCapacity)
+        {
+            _sciTextRange.chrg.cpMin = cpmin;
+            _sciTextRange.chrg.cpMax = cpmax;
+            _sciTextRange.lpstrText = Marshal.AllocHGlobal(stringCapacity);
+        }
+
+        [StructLayout(LayoutKind.Sequential)]
+        struct Sci_TextRange
+        {
+            public CharacterRange chrg;
+            public IntPtr lpstrText;
+        }
+
+        public IntPtr NativePointer { get { _initNativeStruct(); return _ptrSciTextRange; } }
+
+        public string lpstrText { get { _readNativeStruct(); return Marshal.PtrToStringAnsi(_sciTextRange.lpstrText); } }
+
+        public CharacterRange chrg { get { _readNativeStruct(); return _sciTextRange.chrg; } set { _sciTextRange.chrg = value; _initNativeStruct(); } }
+
+        void _initNativeStruct()
+        {
+            if (_ptrSciTextRange == IntPtr.Zero)
+                _ptrSciTextRange = Marshal.AllocHGlobal(Marshal.SizeOf(_sciTextRange));
+            Marshal.StructureToPtr(_sciTextRange, _ptrSciTextRange, false);
+        }
+
+        void _readNativeStruct()
+        {
+            if (_ptrSciTextRange != IntPtr.Zero)
+                _sciTextRange = (Sci_TextRange)Marshal.PtrToStructure(_ptrSciTextRange, typeof(Sci_TextRange));
+        }
+
+        public void Dispose()
+        {
+            if (!_disposed)
+            {
+                if (_sciTextRange.lpstrText != IntPtr.Zero) Marshal.FreeHGlobal(_sciTextRange.lpstrText);
+                if (_ptrSciTextRange != IntPtr.Zero) Marshal.FreeHGlobal(_ptrSciTextRange);
+                _disposed = true;
+            }
+        }
+
+        ~TextRange()
+        {
+            Dispose();
+        }
+    }
+
+
+    /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
+    /* --Autogenerated -- end of section automatically generated from Scintilla.iface */
+
+}

File diff suppressed because it is too large
+ 2591 - 0
NppChnConvPlugin/NppPluginInfrastructure/IScintillaGateway.cs


+ 398 - 0
NppChnConvPlugin/NppPluginInfrastructure/MenuCmdID_h.cs

@@ -0,0 +1,398 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+//
+// This file should stay in sync with the CPP project file
+// "notepad-plus-plus/PowerEditor/src/menuCmdID.h"
+// found at
+// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/menuCmdID.h
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+    public enum NppMenuCmd : uint
+    {
+        IDM = 40000,
+
+        IDM_FILE = (IDM + 1000),
+        IDM_FILE_NEW = (IDM_FILE + 1),
+        IDM_FILE_OPEN = (IDM_FILE + 2),
+        IDM_FILE_CLOSE = (IDM_FILE + 3),
+        IDM_FILE_CLOSEALL = (IDM_FILE + 4),
+        IDM_FILE_CLOSEALL_BUT_CURRENT = (IDM_FILE + 5),
+        IDM_FILE_SAVE = (IDM_FILE + 6),
+        IDM_FILE_SAVEALL = (IDM_FILE + 7),
+        IDM_FILE_SAVEAS = (IDM_FILE + 8),
+        //IDM_FILE_ASIAN_LANG              = (IDM_FILE + 9), 
+        IDM_FILE_PRINT = (IDM_FILE + 10),
+        IDM_FILE_PRINTNOW = 1001,
+        IDM_FILE_EXIT = (IDM_FILE + 11),
+        IDM_FILE_LOADSESSION = (IDM_FILE + 12),
+        IDM_FILE_SAVESESSION = (IDM_FILE + 13),
+        IDM_FILE_RELOAD = (IDM_FILE + 14),
+        IDM_FILE_SAVECOPYAS = (IDM_FILE + 15),
+        IDM_FILE_DELETE = (IDM_FILE + 16),
+        IDM_FILE_RENAME = (IDM_FILE + 17),
+
+        // A mettre � jour si on ajoute nouveau menu item dans le menu "File"
+        IDM_FILEMENU_LASTONE = IDM_FILE_RENAME,
+
+        IDM_EDIT = (IDM + 2000),
+        IDM_EDIT_CUT = (IDM_EDIT + 1),
+        IDM_EDIT_COPY = (IDM_EDIT + 2),
+        IDM_EDIT_UNDO = (IDM_EDIT + 3),
+        IDM_EDIT_REDO = (IDM_EDIT + 4),
+        IDM_EDIT_PASTE = (IDM_EDIT + 5),
+        IDM_EDIT_DELETE = (IDM_EDIT + 6),
+        IDM_EDIT_SELECTALL = (IDM_EDIT + 7),
+
+        IDM_EDIT_INS_TAB = (IDM_EDIT + 8),
+        IDM_EDIT_RMV_TAB = (IDM_EDIT + 9),
+        IDM_EDIT_DUP_LINE = (IDM_EDIT + 10),
+        IDM_EDIT_TRANSPOSE_LINE = (IDM_EDIT + 11),
+        IDM_EDIT_SPLIT_LINES = (IDM_EDIT + 12),
+        IDM_EDIT_JOIN_LINES = (IDM_EDIT + 13),
+        IDM_EDIT_LINE_UP = (IDM_EDIT + 14),
+        IDM_EDIT_LINE_DOWN = (IDM_EDIT + 15),
+        IDM_EDIT_UPPERCASE = (IDM_EDIT + 16),
+        IDM_EDIT_LOWERCASE = (IDM_EDIT + 17),
+
+        // Menu macro
+        IDM_MACRO_STARTRECORDINGMACRO = (IDM_EDIT + 18),
+        IDM_MACRO_STOPRECORDINGMACRO = (IDM_EDIT + 19),
+        IDM_MACRO_PLAYBACKRECORDEDMACRO = (IDM_EDIT + 21),
+        //-----------
+
+        IDM_EDIT_BLOCK_COMMENT = (IDM_EDIT + 22),
+        IDM_EDIT_STREAM_COMMENT = (IDM_EDIT + 23),
+        IDM_EDIT_TRIMTRAILING = (IDM_EDIT + 24),
+        IDM_EDIT_TRIMLINEHEAD = (IDM_EDIT + 42),
+        IDM_EDIT_TRIM_BOTH = (IDM_EDIT + 43),
+        IDM_EDIT_EOL2WS = (IDM_EDIT + 44),
+        IDM_EDIT_TRIMALL = (IDM_EDIT + 45),
+        IDM_EDIT_TAB2SW = (IDM_EDIT + 46),
+        IDM_EDIT_SW2TAB = (IDM_EDIT + 47),
+
+        // Menu macro
+        IDM_MACRO_SAVECURRENTMACRO = (IDM_EDIT + 25),
+        //-----------
+
+        IDM_EDIT_RTL = (IDM_EDIT + 26),
+        IDM_EDIT_LTR = (IDM_EDIT + 27),
+        IDM_EDIT_SETREADONLY = (IDM_EDIT + 28),
+        IDM_EDIT_FULLPATHTOCLIP = (IDM_EDIT + 29),
+        IDM_EDIT_FILENAMETOCLIP = (IDM_EDIT + 30),
+        IDM_EDIT_CURRENTDIRTOCLIP = (IDM_EDIT + 31),
+
+        // Menu macro
+        IDM_MACRO_RUNMULTIMACRODLG = (IDM_EDIT + 32),
+        //-----------
+
+        IDM_EDIT_CLEARREADONLY = (IDM_EDIT + 33),
+        IDM_EDIT_COLUMNMODE = (IDM_EDIT + 34),
+        IDM_EDIT_BLOCK_COMMENT_SET = (IDM_EDIT + 35),
+        IDM_EDIT_BLOCK_UNCOMMENT = (IDM_EDIT + 36),
+
+        IDM_EDIT_AUTOCOMPLETE = (50000 + 0),
+        IDM_EDIT_AUTOCOMPLETE_CURRENTFILE = (50000 + 1),
+        IDM_EDIT_FUNCCALLTIP = (50000 + 2),
+
+        //Belong to MENU FILE
+        IDM_OPEN_ALL_RECENT_FILE = (IDM_EDIT + 40),
+        IDM_CLEAN_RECENT_FILE_LIST = (IDM_EDIT + 41),
+
+        IDM_SEARCH = (IDM + 3000),
+
+        IDM_SEARCH_FIND = (IDM_SEARCH + 1),
+        IDM_SEARCH_FINDNEXT = (IDM_SEARCH + 2),
+        IDM_SEARCH_REPLACE = (IDM_SEARCH + 3),
+        IDM_SEARCH_GOTOLINE = (IDM_SEARCH + 4),
+        IDM_SEARCH_TOGGLE_BOOKMARK = (IDM_SEARCH + 5),
+        IDM_SEARCH_NEXT_BOOKMARK = (IDM_SEARCH + 6),
+        IDM_SEARCH_PREV_BOOKMARK = (IDM_SEARCH + 7),
+        IDM_SEARCH_CLEAR_BOOKMARKS = (IDM_SEARCH + 8),
+        IDM_SEARCH_GOTOMATCHINGBRACE = (IDM_SEARCH + 9),
+        IDM_SEARCH_FINDPREV = (IDM_SEARCH + 10),
+        IDM_SEARCH_FINDINCREMENT = (IDM_SEARCH + 11),
+        IDM_SEARCH_FINDINFILES = (IDM_SEARCH + 13),
+        IDM_SEARCH_VOLATILE_FINDNEXT = (IDM_SEARCH + 14),
+        IDM_SEARCH_VOLATILE_FINDPREV = (IDM_SEARCH + 15),
+        IDM_SEARCH_CUTMARKEDLINES = (IDM_SEARCH + 18),
+        IDM_SEARCH_COPYMARKEDLINES = (IDM_SEARCH + 19),
+        IDM_SEARCH_PASTEMARKEDLINES = (IDM_SEARCH + 20),
+        IDM_SEARCH_DELETEMARKEDLINES = (IDM_SEARCH + 21),
+        IDM_SEARCH_MARKALLEXT1 = (IDM_SEARCH + 22),
+        IDM_SEARCH_UNMARKALLEXT1 = (IDM_SEARCH + 23),
+        IDM_SEARCH_MARKALLEXT2 = (IDM_SEARCH + 24),
+        IDM_SEARCH_UNMARKALLEXT2 = (IDM_SEARCH + 25),
+        IDM_SEARCH_MARKALLEXT3 = (IDM_SEARCH + 26),
+        IDM_SEARCH_UNMARKALLEXT3 = (IDM_SEARCH + 27),
+        IDM_SEARCH_MARKALLEXT4 = (IDM_SEARCH + 28),
+        IDM_SEARCH_UNMARKALLEXT4 = (IDM_SEARCH + 29),
+        IDM_SEARCH_MARKALLEXT5 = (IDM_SEARCH + 30),
+        IDM_SEARCH_UNMARKALLEXT5 = (IDM_SEARCH + 31),
+        IDM_SEARCH_CLEARALLMARKS = (IDM_SEARCH + 32),
+
+        IDM_SEARCH_GOPREVMARKER1 = (IDM_SEARCH + 33),
+        IDM_SEARCH_GOPREVMARKER2 = (IDM_SEARCH + 34),
+        IDM_SEARCH_GOPREVMARKER3 = (IDM_SEARCH + 35),
+        IDM_SEARCH_GOPREVMARKER4 = (IDM_SEARCH + 36),
+        IDM_SEARCH_GOPREVMARKER5 = (IDM_SEARCH + 37),
+        IDM_SEARCH_GOPREVMARKER_DEF = (IDM_SEARCH + 38),
+
+        IDM_SEARCH_GONEXTMARKER1 = (IDM_SEARCH + 39),
+        IDM_SEARCH_GONEXTMARKER2 = (IDM_SEARCH + 40),
+        IDM_SEARCH_GONEXTMARKER3 = (IDM_SEARCH + 41),
+        IDM_SEARCH_GONEXTMARKER4 = (IDM_SEARCH + 42),
+        IDM_SEARCH_GONEXTMARKER5 = (IDM_SEARCH + 43),
+        IDM_SEARCH_GONEXTMARKER_DEF = (IDM_SEARCH + 44),
+
+        IDM_FOCUS_ON_FOUND_RESULTS = (IDM_SEARCH + 45),
+        IDM_SEARCH_GOTONEXTFOUND = (IDM_SEARCH + 46),
+        IDM_SEARCH_GOTOPREVFOUND = (IDM_SEARCH + 47),
+
+        IDM_SEARCH_SETANDFINDNEXT = (IDM_SEARCH + 48),
+        IDM_SEARCH_SETANDFINDPREV = (IDM_SEARCH + 49),
+        IDM_SEARCH_INVERSEMARKS = (IDM_SEARCH + 50),
+
+        IDM_VIEW = (IDM + 4000),
+        //IDM_VIEW_TOOLBAR_HIDE            = (IDM_VIEW + 1),
+        IDM_VIEW_TOOLBAR_REDUCE = (IDM_VIEW + 2),
+        IDM_VIEW_TOOLBAR_ENLARGE = (IDM_VIEW + 3),
+        IDM_VIEW_TOOLBAR_STANDARD = (IDM_VIEW + 4),
+        IDM_VIEW_REDUCETABBAR = (IDM_VIEW + 5),
+        IDM_VIEW_LOCKTABBAR = (IDM_VIEW + 6),
+        IDM_VIEW_DRAWTABBAR_TOPBAR = (IDM_VIEW + 7),
+        IDM_VIEW_DRAWTABBAR_INACIVETAB = (IDM_VIEW + 8),
+        IDM_VIEW_POSTIT = (IDM_VIEW + 9),
+        IDM_VIEW_TOGGLE_FOLDALL = (IDM_VIEW + 10),
+        IDM_VIEW_USER_DLG = (IDM_VIEW + 11),
+        IDM_VIEW_LINENUMBER = (IDM_VIEW + 12),
+        IDM_VIEW_SYMBOLMARGIN = (IDM_VIEW + 13),
+        IDM_VIEW_FOLDERMAGIN = (IDM_VIEW + 14),
+        IDM_VIEW_FOLDERMAGIN_SIMPLE = (IDM_VIEW + 15),
+        IDM_VIEW_FOLDERMAGIN_ARROW = (IDM_VIEW + 16),
+        IDM_VIEW_FOLDERMAGIN_CIRCLE = (IDM_VIEW + 17),
+        IDM_VIEW_FOLDERMAGIN_BOX = (IDM_VIEW + 18),
+        IDM_VIEW_ALL_CHARACTERS = (IDM_VIEW + 19),
+        IDM_VIEW_INDENT_GUIDE = (IDM_VIEW + 20),
+        IDM_VIEW_CURLINE_HILITING = (IDM_VIEW + 21),
+        IDM_VIEW_WRAP = (IDM_VIEW + 22),
+        IDM_VIEW_ZOOMIN = (IDM_VIEW + 23),
+        IDM_VIEW_ZOOMOUT = (IDM_VIEW + 24),
+        IDM_VIEW_TAB_SPACE = (IDM_VIEW + 25),
+        IDM_VIEW_EOL = (IDM_VIEW + 26),
+        IDM_VIEW_EDGELINE = (IDM_VIEW + 27),
+        IDM_VIEW_EDGEBACKGROUND = (IDM_VIEW + 28),
+        IDM_VIEW_TOGGLE_UNFOLDALL = (IDM_VIEW + 29),
+        IDM_VIEW_FOLD_CURRENT = (IDM_VIEW + 30),
+        IDM_VIEW_UNFOLD_CURRENT = (IDM_VIEW + 31),
+        IDM_VIEW_FULLSCREENTOGGLE = (IDM_VIEW + 32),
+        IDM_VIEW_ZOOMRESTORE = (IDM_VIEW + 33),
+        IDM_VIEW_ALWAYSONTOP = (IDM_VIEW + 34),
+        IDM_VIEW_SYNSCROLLV = (IDM_VIEW + 35),
+        IDM_VIEW_SYNSCROLLH = (IDM_VIEW + 36),
+        IDM_VIEW_EDGENONE = (IDM_VIEW + 37),
+        IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN = (IDM_VIEW + 38),
+        IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE = (IDM_VIEW + 39),
+        IDM_VIEW_REFRESHTABAR = (IDM_VIEW + 40),
+        IDM_VIEW_WRAP_SYMBOL = (IDM_VIEW + 41),
+        IDM_VIEW_HIDELINES = (IDM_VIEW + 42),
+        IDM_VIEW_DRAWTABBAR_VERTICAL = (IDM_VIEW + 43),
+        IDM_VIEW_DRAWTABBAR_MULTILINE = (IDM_VIEW + 44),
+        IDM_VIEW_DOCCHANGEMARGIN = (IDM_VIEW + 45),
+        IDM_VIEW_LWDEF = (IDM_VIEW + 46),
+        IDM_VIEW_LWALIGN = (IDM_VIEW + 47),
+        IDM_VIEW_LWINDENT = (IDM_VIEW + 48),
+        IDM_VIEW_SUMMARY = (IDM_VIEW + 49),
+
+        IDM_VIEW_FOLD = (IDM_VIEW + 50),
+        IDM_VIEW_FOLD_1 = (IDM_VIEW_FOLD + 1),
+        IDM_VIEW_FOLD_2 = (IDM_VIEW_FOLD + 2),
+        IDM_VIEW_FOLD_3 = (IDM_VIEW_FOLD + 3),
+        IDM_VIEW_FOLD_4 = (IDM_VIEW_FOLD + 4),
+        IDM_VIEW_FOLD_5 = (IDM_VIEW_FOLD + 5),
+        IDM_VIEW_FOLD_6 = (IDM_VIEW_FOLD + 6),
+        IDM_VIEW_FOLD_7 = (IDM_VIEW_FOLD + 7),
+        IDM_VIEW_FOLD_8 = (IDM_VIEW_FOLD + 8),
+
+        IDM_VIEW_UNFOLD = (IDM_VIEW + 60),
+        IDM_VIEW_UNFOLD_1 = (IDM_VIEW_UNFOLD + 1),
+        IDM_VIEW_UNFOLD_2 = (IDM_VIEW_UNFOLD + 2),
+        IDM_VIEW_UNFOLD_3 = (IDM_VIEW_UNFOLD + 3),
+        IDM_VIEW_UNFOLD_4 = (IDM_VIEW_UNFOLD + 4),
+        IDM_VIEW_UNFOLD_5 = (IDM_VIEW_UNFOLD + 5),
+        IDM_VIEW_UNFOLD_6 = (IDM_VIEW_UNFOLD + 6),
+        IDM_VIEW_UNFOLD_7 = (IDM_VIEW_UNFOLD + 7),
+        IDM_VIEW_UNFOLD_8 = (IDM_VIEW_UNFOLD + 8),
+
+        IDM_VIEW_GOTO_ANOTHER_VIEW = 10001,
+        IDM_VIEW_CLONE_TO_ANOTHER_VIEW = 10002,
+        IDM_VIEW_GOTO_NEW_INSTANCE = 10003,
+        IDM_VIEW_LOAD_IN_NEW_INSTANCE = 10004,
+
+        IDM_VIEW_SWITCHTO_OTHER_VIEW = (IDM_VIEW + 72),
+
+        IDM_FORMAT = (IDM + 5000),
+        IDM_FORMAT_TODOS = (IDM_FORMAT + 1),
+        IDM_FORMAT_TOUNIX = (IDM_FORMAT + 2),
+        IDM_FORMAT_TOMAC = (IDM_FORMAT + 3),
+        IDM_FORMAT_ANSI = (IDM_FORMAT + 4),
+        IDM_FORMAT_UTF_8 = (IDM_FORMAT + 5),
+        IDM_FORMAT_UCS_2BE = (IDM_FORMAT + 6),
+        IDM_FORMAT_UCS_2LE = (IDM_FORMAT + 7),
+        IDM_FORMAT_AS_UTF_8 = (IDM_FORMAT + 8),
+        IDM_FORMAT_CONV2_ANSI = (IDM_FORMAT + 9),
+        IDM_FORMAT_CONV2_AS_UTF_8 = (IDM_FORMAT + 10),
+        IDM_FORMAT_CONV2_UTF_8 = (IDM_FORMAT + 11),
+        IDM_FORMAT_CONV2_UCS_2BE = (IDM_FORMAT + 12),
+        IDM_FORMAT_CONV2_UCS_2LE = (IDM_FORMAT + 13),
+
+        IDM_FORMAT_ENCODE = (IDM_FORMAT + 20),
+        IDM_FORMAT_WIN_1250 = (IDM_FORMAT_ENCODE + 0),
+        IDM_FORMAT_WIN_1251 = (IDM_FORMAT_ENCODE + 1),
+        IDM_FORMAT_WIN_1252 = (IDM_FORMAT_ENCODE + 2),
+        IDM_FORMAT_WIN_1253 = (IDM_FORMAT_ENCODE + 3),
+        IDM_FORMAT_WIN_1254 = (IDM_FORMAT_ENCODE + 4),
+        IDM_FORMAT_WIN_1255 = (IDM_FORMAT_ENCODE + 5),
+        IDM_FORMAT_WIN_1256 = (IDM_FORMAT_ENCODE + 6),
+        IDM_FORMAT_WIN_1257 = (IDM_FORMAT_ENCODE + 7),
+        IDM_FORMAT_WIN_1258 = (IDM_FORMAT_ENCODE + 8),
+        IDM_FORMAT_ISO_8859_1 = (IDM_FORMAT_ENCODE + 9),
+        IDM_FORMAT_ISO_8859_2 = (IDM_FORMAT_ENCODE + 10),
+        IDM_FORMAT_ISO_8859_3 = (IDM_FORMAT_ENCODE + 11),
+        IDM_FORMAT_ISO_8859_4 = (IDM_FORMAT_ENCODE + 12),
+        IDM_FORMAT_ISO_8859_5 = (IDM_FORMAT_ENCODE + 13),
+        IDM_FORMAT_ISO_8859_6 = (IDM_FORMAT_ENCODE + 14),
+        IDM_FORMAT_ISO_8859_7 = (IDM_FORMAT_ENCODE + 15),
+        IDM_FORMAT_ISO_8859_8 = (IDM_FORMAT_ENCODE + 16),
+        IDM_FORMAT_ISO_8859_9 = (IDM_FORMAT_ENCODE + 17),
+        IDM_FORMAT_ISO_8859_10 = (IDM_FORMAT_ENCODE + 18),
+        IDM_FORMAT_ISO_8859_11 = (IDM_FORMAT_ENCODE + 19),
+        IDM_FORMAT_ISO_8859_13 = (IDM_FORMAT_ENCODE + 20),
+        IDM_FORMAT_ISO_8859_14 = (IDM_FORMAT_ENCODE + 21),
+        IDM_FORMAT_ISO_8859_15 = (IDM_FORMAT_ENCODE + 22),
+        IDM_FORMAT_ISO_8859_16 = (IDM_FORMAT_ENCODE + 23),
+        IDM_FORMAT_DOS_437 = (IDM_FORMAT_ENCODE + 24),
+        IDM_FORMAT_DOS_720 = (IDM_FORMAT_ENCODE + 25),
+        IDM_FORMAT_DOS_737 = (IDM_FORMAT_ENCODE + 26),
+        IDM_FORMAT_DOS_775 = (IDM_FORMAT_ENCODE + 27),
+        IDM_FORMAT_DOS_850 = (IDM_FORMAT_ENCODE + 28),
+        IDM_FORMAT_DOS_852 = (IDM_FORMAT_ENCODE + 29),
+        IDM_FORMAT_DOS_855 = (IDM_FORMAT_ENCODE + 30),
+        IDM_FORMAT_DOS_857 = (IDM_FORMAT_ENCODE + 31),
+        IDM_FORMAT_DOS_858 = (IDM_FORMAT_ENCODE + 32),
+        IDM_FORMAT_DOS_860 = (IDM_FORMAT_ENCODE + 33),
+        IDM_FORMAT_DOS_861 = (IDM_FORMAT_ENCODE + 34),
+        IDM_FORMAT_DOS_862 = (IDM_FORMAT_ENCODE + 35),
+        IDM_FORMAT_DOS_863 = (IDM_FORMAT_ENCODE + 36),
+        IDM_FORMAT_DOS_865 = (IDM_FORMAT_ENCODE + 37),
+        IDM_FORMAT_DOS_866 = (IDM_FORMAT_ENCODE + 38),
+        IDM_FORMAT_DOS_869 = (IDM_FORMAT_ENCODE + 39),
+        IDM_FORMAT_BIG5 = (IDM_FORMAT_ENCODE + 40),
+        IDM_FORMAT_GB2312 = (IDM_FORMAT_ENCODE + 41),
+        IDM_FORMAT_SHIFT_JIS = (IDM_FORMAT_ENCODE + 42),
+        IDM_FORMAT_KOREAN_WIN = (IDM_FORMAT_ENCODE + 43),
+        IDM_FORMAT_EUC_KR = (IDM_FORMAT_ENCODE + 44),
+        IDM_FORMAT_TIS_620 = (IDM_FORMAT_ENCODE + 45),
+        IDM_FORMAT_MAC_CYRILLIC = (IDM_FORMAT_ENCODE + 46),
+        IDM_FORMAT_KOI8U_CYRILLIC = (IDM_FORMAT_ENCODE + 47),
+        IDM_FORMAT_KOI8R_CYRILLIC = (IDM_FORMAT_ENCODE + 48),
+        IDM_FORMAT_ENCODE_END = IDM_FORMAT_KOI8R_CYRILLIC,
+
+        //#define    IDM_FORMAT_CONVERT            200
+
+        IDM_LANG = (IDM + 6000),
+        IDM_LANGSTYLE_CONFIG_DLG = (IDM_LANG + 1),
+        IDM_LANG_C = (IDM_LANG + 2),
+        IDM_LANG_CPP = (IDM_LANG + 3),
+        IDM_LANG_JAVA = (IDM_LANG + 4),
+        IDM_LANG_HTML = (IDM_LANG + 5),
+        IDM_LANG_XML = (IDM_LANG + 6),
+        IDM_LANG_JS = (IDM_LANG + 7),
+        IDM_LANG_PHP = (IDM_LANG + 8),
+        IDM_LANG_ASP = (IDM_LANG + 9),
+        IDM_LANG_CSS = (IDM_LANG + 10),
+        IDM_LANG_PASCAL = (IDM_LANG + 11),
+        IDM_LANG_PYTHON = (IDM_LANG + 12),
+        IDM_LANG_PERL = (IDM_LANG + 13),
+        IDM_LANG_OBJC = (IDM_LANG + 14),
+        IDM_LANG_ASCII = (IDM_LANG + 15),
+        IDM_LANG_TEXT = (IDM_LANG + 16),
+        IDM_LANG_RC = (IDM_LANG + 17),
+        IDM_LANG_MAKEFILE = (IDM_LANG + 18),
+        IDM_LANG_INI = (IDM_LANG + 19),
+        IDM_LANG_SQL = (IDM_LANG + 20),
+        IDM_LANG_VB = (IDM_LANG + 21),
+        IDM_LANG_BATCH = (IDM_LANG + 22),
+        IDM_LANG_CS = (IDM_LANG + 23),
+        IDM_LANG_LUA = (IDM_LANG + 24),
+        IDM_LANG_TEX = (IDM_LANG + 25),
+        IDM_LANG_FORTRAN = (IDM_LANG + 26),
+        IDM_LANG_BASH = (IDM_LANG + 27),
+        IDM_LANG_FLASH = (IDM_LANG + 28),
+        IDM_LANG_NSIS = (IDM_LANG + 29),
+        IDM_LANG_TCL = (IDM_LANG + 30),
+        IDM_LANG_LISP = (IDM_LANG + 31),
+        IDM_LANG_SCHEME = (IDM_LANG + 32),
+        IDM_LANG_ASM = (IDM_LANG + 33),
+        IDM_LANG_DIFF = (IDM_LANG + 34),
+        IDM_LANG_PROPS = (IDM_LANG + 35),
+        IDM_LANG_PS = (IDM_LANG + 36),
+        IDM_LANG_RUBY = (IDM_LANG + 37),
+        IDM_LANG_SMALLTALK = (IDM_LANG + 38),
+        IDM_LANG_VHDL = (IDM_LANG + 39),
+        IDM_LANG_CAML = (IDM_LANG + 40),
+        IDM_LANG_KIX = (IDM_LANG + 41),
+        IDM_LANG_ADA = (IDM_LANG + 42),
+        IDM_LANG_VERILOG = (IDM_LANG + 43),
+        IDM_LANG_AU3 = (IDM_LANG + 44),
+        IDM_LANG_MATLAB = (IDM_LANG + 45),
+        IDM_LANG_HASKELL = (IDM_LANG + 46),
+        IDM_LANG_INNO = (IDM_LANG + 47),
+        IDM_LANG_CMAKE = (IDM_LANG + 48),
+        IDM_LANG_YAML = (IDM_LANG + 49),
+        IDM_LANG_COBOL = (IDM_LANG + 50),
+        IDM_LANG_D = (IDM_LANG + 51),
+        IDM_LANG_GUI4CLI = (IDM_LANG + 52),
+        IDM_LANG_POWERSHELL = (IDM_LANG + 53),
+        IDM_LANG_R = (IDM_LANG + 54),
+        IDM_LANG_JSP = (IDM_LANG + 55),
+        IDM_LANG_EXTERNAL = (IDM_LANG + 65),
+        IDM_LANG_EXTERNAL_LIMIT = (IDM_LANG + 79),
+        IDM_LANG_USER = (IDM_LANG + 80),     //46080
+        IDM_LANG_USER_LIMIT = (IDM_LANG + 110),    //46110
+
+        IDM_ABOUT = (IDM + 7000),
+        IDM_HOMESWEETHOME = (IDM_ABOUT + 1),
+        IDM_PROJECTPAGE = (IDM_ABOUT + 2),
+        IDM_ONLINEHELP = (IDM_ABOUT + 3),
+        IDM_FORUM = (IDM_ABOUT + 4),
+        IDM_PLUGINSHOME = (IDM_ABOUT + 5),
+        IDM_UPDATE_NPP = (IDM_ABOUT + 6),
+        IDM_WIKIFAQ = (IDM_ABOUT + 7),
+        IDM_HELP = (IDM_ABOUT + 8),
+
+        IDM_SETTING = (IDM + 8000),
+        IDM_SETTING_TAB_SIZE = (IDM_SETTING + 1),
+        IDM_SETTING_TAB_REPLCESPACE = (IDM_SETTING + 2),
+        IDM_SETTING_HISTORY_SIZE = (IDM_SETTING + 3),
+        IDM_SETTING_EDGE_SIZE = (IDM_SETTING + 4),
+        IDM_SETTING_IMPORTPLUGIN = (IDM_SETTING + 5),
+        IDM_SETTING_IMPORTSTYLETHEMS = (IDM_SETTING + 6),
+        IDM_SETTING_TRAYICON = (IDM_SETTING + 8),
+        IDM_SETTING_SHORTCUT_MAPPER = (IDM_SETTING + 9),
+        IDM_SETTING_REMEMBER_LAST_SESSION = (IDM_SETTING + 10),
+        IDM_SETTING_PREFERECE = (IDM_SETTING + 11),
+        IDM_SETTING_AUTOCNBCHAR = (IDM_SETTING + 15),
+        IDM_SETTING_SHORTCUT_MAPPER_MACRO = (IDM_SETTING + 16),
+        IDM_SETTING_SHORTCUT_MAPPER_RUN = (IDM_SETTING + 17),
+        IDM_SETTING_EDITCONTEXTMENU = (IDM_SETTING + 18),
+
+        IDM_EXECUTE = (IDM + 9000),
+
+        IDM_SYSTRAYPOPUP = (IDM + 3100),
+        IDM_SYSTRAYPOPUP_ACTIVATE = (IDM_SYSTRAYPOPUP + 1),
+        IDM_SYSTRAYPOPUP_NEWDOC = (IDM_SYSTRAYPOPUP + 2),
+        IDM_SYSTRAYPOPUP_NEW_AND_PASTE = (IDM_SYSTRAYPOPUP + 3),
+        IDM_SYSTRAYPOPUP_OPENFILE = (IDM_SYSTRAYPOPUP + 4),
+        IDM_SYSTRAYPOPUP_CLOSE = (IDM_SYSTRAYPOPUP + 5)
+    }
+}

+ 764 - 0
NppChnConvPlugin/NppPluginInfrastructure/Msgs_h.cs

@@ -0,0 +1,764 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+//
+// This file should stay in sync with the CPP project file
+// "notepad-plus-plus/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h"
+// found at
+// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h
+
+using System;
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+    class Constants
+    {
+        public const int WM_USER = 0x400;
+        public const int NPPMSG = WM_USER + 1000;
+    }
+
+    public enum LangType
+    {
+        L_TEXT, L_PHP, L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,
+        L_HTML, L_XML, L_MAKEFILE, L_PASCAL, L_BATCH, L_INI, L_ASCII, L_USER,
+        L_ASP, L_SQL, L_VB, L_JS, L_CSS, L_PERL, L_PYTHON, L_LUA,
+        L_TEX, L_FORTRAN, L_BASH, L_FLASH, L_NSIS, L_TCL, L_LISP, L_SCHEME,
+        L_ASM, L_DIFF, L_PROPS, L_PS, L_RUBY, L_SMALLTALK, L_VHDL, L_KIX, L_AU3,
+        L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO, L_SEARCHRESULT,
+        L_CMAKE, L_YAML, L_COBOL, L_GUI4CLI, L_D, L_POWERSHELL, L_R, L_JSP,
+        L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77,
+        // Don't use L_JS, use L_JAVASCRIPT instead
+        // The end of enumated language type, so it should be always at the end
+        L_EXTERNAL
+    }
+
+    [Flags]
+    public enum NppMsg : uint
+    {
+        /* ++Autogenerated -- start of section automatically generated from notepad-plus-plus\PowerEditor\src\MISC\PluginsManager\Notepad_plus_msgs.h */
+
+        NPPMSG = Constants.WM_USER + 1000,
+
+        NPPM_GETCURRENTSCINTILLA = Constants.NPPMSG + 4,
+        NPPM_GETCURRENTLANGTYPE = Constants.NPPMSG + 5,
+        NPPM_SETCURRENTLANGTYPE = Constants.NPPMSG + 6,
+
+        NPPM_GETNBOPENFILES = Constants.NPPMSG + 7,
+        ALL_OPEN_FILES = 0,
+        PRIMARY_VIEW = 1,
+        SECOND_VIEW = 2,
+
+        NPPM_GETOPENFILENAMES = Constants.NPPMSG + 8,
+
+        NPPM_MODELESSDIALOG = Constants.NPPMSG + 12,
+        MODELESSDIALOGADD = 0,
+        MODELESSDIALOGREMOVE = 1,
+
+        NPPM_GETNBSESSIONFILES = Constants.NPPMSG + 13,
+        NPPM_GETSESSIONFILES = Constants.NPPMSG + 14,
+        NPPM_SAVESESSION = Constants.NPPMSG + 15,
+        NPPM_SAVECURRENTSESSION = Constants.NPPMSG + 16,
+
+        NPPM_GETOPENFILENAMESPRIMARY = Constants.NPPMSG + 17,
+        NPPM_GETOPENFILENAMESSECOND = Constants.NPPMSG + 18,
+
+        NPPM_CREATESCINTILLAHANDLE = Constants.NPPMSG + 20,
+        NPPM_DESTROYSCINTILLAHANDLE = Constants.NPPMSG + 21,
+        NPPM_GETNBUSERLANG = Constants.NPPMSG + 22,
+
+        NPPM_GETCURRENTDOCINDEX = Constants.NPPMSG + 23,
+        MAIN_VIEW = 0,
+        SUB_VIEW = 1,
+
+        NPPM_SETSTATUSBAR = Constants.NPPMSG + 24,
+        STATUSBAR_DOC_TYPE = 0,
+        STATUSBAR_DOC_SIZE = 1,
+        STATUSBAR_CUR_POS = 2,
+        STATUSBAR_EOF_FORMAT = 3,
+        STATUSBAR_UNICODE_TYPE = 4,
+        STATUSBAR_TYPING_MODE = 5,
+
+        NPPM_GETMENUHANDLE = Constants.NPPMSG + 25,
+        NPPPLUGINMENU = 0,
+        /// <summary>
+        /// INT NPPM_GETMENUHANDLE(INT menuChoice, 0)
+        /// Return: menu handle (HMENU) of choice (plugin menu handle or Notepad++ main menu handle)
+        /// </summary>
+        NPPMAINMENU = 1,
+
+        /// <summary>
+        ///ascii file to unicode
+        ///int NPPM_ENCODESCI(MAIN_VIEW/SUB_VIEW, 0)
+        ///return new unicodeMode
+        /// </summary>
+        NPPM_ENCODESCI = Constants.NPPMSG + 26,
+
+        /// <summary>
+        ///unicode file to ascii
+        ///int NPPM_DECODESCI(MAIN_VIEW/SUB_VIEW, 0)
+        ///return old unicodeMode
+        /// </summary>
+        NPPM_DECODESCI = Constants.NPPMSG + 27,
+
+        /// <summary>
+        ///void NPPM_ACTIVATEDOC(int view, int index2Activate)
+        /// </summary>
+        NPPM_ACTIVATEDOC = Constants.NPPMSG + 28,
+
+        /// <summary>
+        ///void NPPM_LAUNCHFINDINFILESDLG(TCHAR * dir2Search, TCHAR * filtre)
+        /// </summary>
+        NPPM_LAUNCHFINDINFILESDLG = Constants.NPPMSG + 29,
+
+        /// <summary>
+        ///void NPPM_DMMSHOW(0, tTbData->hClient)
+        /// </summary>
+        NPPM_DMMSHOW = Constants.NPPMSG + 30,
+
+        /// <summary>
+        ///void NPPM_DMMHIDE(0, tTbData->hClient)
+        /// </summary>
+        NPPM_DMMHIDE = Constants.NPPMSG + 31,
+
+        /// <summary>
+        ///void NPPM_DMMUPDATEDISPINFO(0, tTbData->hClient)
+        /// </summary>
+        NPPM_DMMUPDATEDISPINFO = Constants.NPPMSG + 32,
+
+        /// <summary>
+        ///void NPPM_DMMREGASDCKDLG(0, &tTbData)
+        /// </summary>
+        NPPM_DMMREGASDCKDLG = Constants.NPPMSG + 33,
+
+        /// <summary>
+        ///void NPPM_LOADSESSION(0, const TCHAR* file name)
+        /// </summary>
+        NPPM_LOADSESSION = Constants.NPPMSG + 34,
+
+        /// <summary>
+        ///void WM_DMM_VIEWOTHERTAB(0, tTbData->pszName)
+        /// </summary>
+        NPPM_DMMVIEWOTHERTAB = Constants.NPPMSG + 35,
+
+        /// <summary>
+        ///BOOL NPPM_RELOADFILE(BOOL withAlert, TCHAR *filePathName2Reload)
+        /// </summary>
+        NPPM_RELOADFILE = Constants.NPPMSG + 36,
+
+        /// <summary>
+        ///BOOL NPPM_SWITCHTOFILE(0, TCHAR *filePathName2switch)
+        /// </summary>
+        NPPM_SWITCHTOFILE = Constants.NPPMSG + 37,
+
+        /// <summary>
+        ///BOOL NPPM_SAVECURRENTFILE(0, 0)
+        /// </summary>
+        NPPM_SAVECURRENTFILE = Constants.NPPMSG + 38,
+
+        /// <summary>
+        ///BOOL NPPM_SAVEALLFILES(0, 0)
+        /// </summary>
+        NPPM_SAVEALLFILES = Constants.NPPMSG + 39,
+
+        /// <summary>
+        ///void WM_PIMENU_CHECK(UINT	funcItem[X]._cmdID, TRUE/FALSE)
+        /// </summary>
+        NPPM_SETMENUITEMCHECK = Constants.NPPMSG + 40,
+
+        /// <summary>
+        ///void WM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons icon)
+        /// </summary>
+        NPPM_ADDTOOLBARICON = Constants.NPPMSG + 41,
+
+        /// <summary>
+        ///winVer NPPM_GETWINDOWSVERSION(0, 0)
+        /// </summary>
+        NPPM_GETWINDOWSVERSION = Constants.NPPMSG + 42,
+
+        /// <summary>
+        ///HWND WM_DMM_GETPLUGINHWNDBYNAME(const TCHAR *windowName, const TCHAR *moduleName)
+        /// if moduleName is NULL, then return value is NULL
+        /// if windowName is NULL, then the first found window handle which matches with the moduleName will be returned
+        /// </summary>
+        NPPM_DMMGETPLUGINHWNDBYNAME = Constants.NPPMSG + 43,
+
+        /// <summary>
+        ///BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0)
+        /// </summary>
+        NPPM_MAKECURRENTBUFFERDIRTY = Constants.NPPMSG + 44,
+
+        /// <summary>
+        ///BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0)
+        /// </summary>
+        NPPM_GETENABLETHEMETEXTUREFUNC = Constants.NPPMSG + 45,
+
+        /// <summary>
+        ///void NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str)
+        /// </summary>
+        NPPM_GETPLUGINSCONFIGDIR = Constants.NPPMSG + 46,
+
+        /// <summary>
+        ///BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info)
+        /// return value is TRUE when the message arrive to the destination plugins.
+        /// if destModule or info is NULL, then return value is FALSE
+        /// </summary>
+        NPPM_MSGTOPLUGIN = Constants.NPPMSG + 47,
+
+        /// <summary>
+        ///void NPPM_MENUCOMMAND(0, int cmdID)
+        /// uncomment //#include "menuCmdID.h"
+        /// in the beginning of this file then use the command symbols defined in "menuCmdID.h" file
+        /// to access all the Notepad++ menu command items
+        /// </summary>
+        NPPM_MENUCOMMAND = Constants.NPPMSG + 48,
+
+        /// <summary>
+        ///void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate)
+        /// </summary>
+        NPPM_TRIGGERTABBARCONTEXTMENU = Constants.NPPMSG + 49,
+
+        /// <summary>
+        /// int NPPM_GETNPPVERSION(0, 0)
+        /// return version
+        /// ex : v4.6
+        /// HIWORD(version) == 4
+        /// LOWORD(version) == 6
+        /// </summary>
+        NPPM_GETNPPVERSION = Constants.NPPMSG + 50,
+
+        /// <summary>
+        /// BOOL NPPM_HIDETABBAR(0, BOOL hideOrNot)
+        /// if hideOrNot is set as TRUE then tab bar will be hidden
+        /// otherwise it'll be shown.
+        /// return value : the old status value
+        /// </summary>
+        NPPM_HIDETABBAR = Constants.NPPMSG + 51,
+
+        /// <summary>
+        /// BOOL NPPM_ISTABBARHIDDEN(0, 0)
+        /// returned value : TRUE if tab bar is hidden, otherwise FALSE
+        /// </summary>
+        NPPM_ISTABBARHIDDEN = Constants.NPPMSG + 52,
+
+        /// <summary>
+        /// INT NPPM_GETPOSFROMBUFFERID(INT bufferID, INT priorityView)
+        /// Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing
+        /// if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly
+        ///
+        /// VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits)
+        /// Here's the values for the view :
+        ///  MAIN_VIEW 0
+        ///  SUB_VIEW  1
+        /// </summary>
+        NPPM_GETPOSFROMBUFFERID = Constants.NPPMSG + 57,
+
+        /// <summary>
+        /// INT NPPM_GETFULLPATHFROMBUFFERID(INT bufferID, TCHAR *fullFilePath)
+        /// Get full path file name from a bufferID.
+        /// Return -1 if the bufferID non existing, otherwise the number of TCHAR copied/to copy
+        /// User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character),
+        /// allocate fullFilePath with the return values + 1, then call it again to get  full path file name
+        /// </summary>
+        NPPM_GETFULLPATHFROMBUFFERID = Constants.NPPMSG + 58,
+
+        /// <summary>
+        /// LRESULT NPPM_GETBUFFERIDFROMPOS(INT index, INT iView)
+        /// wParam: Position of document
+        /// lParam: View to use, 0 = Main, 1 = Secondary
+        /// Returns 0 if invalid
+        /// </summary>
+        NPPM_GETBUFFERIDFROMPOS = Constants.NPPMSG + 59,
+
+        /// <summary>
+        /// LRESULT NPPM_GETCURRENTBUFFERID(0, 0)
+        /// Returns active Buffer
+        /// </summary>
+        NPPM_GETCURRENTBUFFERID = Constants.NPPMSG + 60,
+
+        /// <summary>
+        /// VOID NPPM_RELOADBUFFERID(0, 0)
+        /// Reloads Buffer
+        /// wParam: Buffer to reload
+        /// lParam: 0 if no alert, else alert
+        /// </summary>
+        NPPM_RELOADBUFFERID = Constants.NPPMSG + 61,
+
+        /// <summary>
+        /// INT NPPM_GETBUFFERLANGTYPE(INT bufferID, 0)
+        /// wParam: BufferID to get LangType from
+        /// lParam: 0
+        /// Returns as int, see LangType. -1 on error
+        /// </summary>
+        NPPM_GETBUFFERLANGTYPE = Constants.NPPMSG + 64,
+
+        /// <summary>
+        /// BOOL NPPM_SETBUFFERLANGTYPE(INT bufferID, INT langType)
+        /// wParam: BufferID to set LangType of
+        /// lParam: LangType
+        /// Returns TRUE on success, FALSE otherwise
+        /// use int, see LangType for possible values
+        /// L_USER and L_EXTERNAL are not supported
+        /// </summary>
+        NPPM_SETBUFFERLANGTYPE = Constants.NPPMSG + 65,
+
+        /// <summary>
+        /// INT NPPM_GETBUFFERENCODING(INT bufferID, 0)
+        /// wParam: BufferID to get encoding from
+        /// lParam: 0
+        /// returns as int, see UniMode. -1 on error
+        /// </summary>
+        NPPM_GETBUFFERENCODING = Constants.NPPMSG + 66,
+
+        /// <summary>
+        /// BOOL NPPM_SETBUFFERENCODING(INT bufferID, INT encoding)
+        /// wParam: BufferID to set encoding of
+        /// lParam: encoding
+        /// Returns TRUE on success, FALSE otherwise
+        /// use int, see UniMode
+        /// Can only be done on new, unedited files
+        /// </summary>
+        NPPM_SETBUFFERENCODING = Constants.NPPMSG + 67,
+
+        /// <summary>
+        /// INT NPPM_GETBUFFERFORMAT(INT bufferID, 0)
+        /// wParam: BufferID to get format from
+        /// lParam: 0
+        /// returns as int, see formatType. -1 on error
+        /// </summary>
+        NPPM_GETBUFFERFORMAT = Constants.NPPMSG + 68,
+
+        /// <summary>
+        /// BOOL NPPM_SETBUFFERFORMAT(INT bufferID, INT format)
+        /// wParam: BufferID to set format of
+        /// lParam: format
+        /// Returns TRUE on success, FALSE otherwise
+        /// use int, see formatType
+        /// </summary>
+        NPPM_SETBUFFERFORMAT = Constants.NPPMSG + 69,
+
+        /// <summary>
+        /// BOOL NPPM_ADDREBAR(0, REBARBANDINFO *)
+        /// Returns assigned ID in wID value of struct pointer
+        /// </summary>
+        NPPM_ADDREBAR = Constants.NPPMSG + 57,
+
+        /// <summary>
+        /// BOOL NPPM_ADDREBAR(INT ID, REBARBANDINFO *)
+        ///Use ID assigned with NPPM_ADDREBAR
+        /// </summary>
+        NPPM_UPDATEREBAR = Constants.NPPMSG + 58,
+
+        /// <summary>
+        /// BOOL NPPM_ADDREBAR(INT ID, 0)
+        ///Use ID assigned with NPPM_ADDREBAR
+        /// </summary>
+        NPPM_REMOVEREBAR = Constants.NPPMSG + 59,
+
+        /// <summary>
+        /// BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot)
+        /// if hideOrNot is set as TRUE then tool bar will be hidden
+        /// otherwise it'll be shown.
+        /// return value : the old status value
+        /// </summary>
+        NPPM_HIDETOOLBAR = Constants.NPPMSG + 70,
+
+        /// <summary>
+        /// BOOL NPPM_ISTOOLBARHIDDEN(0, 0)
+        /// returned value : TRUE if tool bar is hidden, otherwise FALSE
+        /// </summary>
+        NPPM_ISTOOLBARHIDDEN = Constants.NPPMSG + 71,
+
+        /// <summary>
+        /// BOOL NPPM_HIDEMENU(0, BOOL hideOrNot)
+        /// if hideOrNot is set as TRUE then menu will be hidden
+        /// otherwise it'll be shown.
+        /// return value : the old status value
+        /// </summary>
+        NPPM_HIDEMENU = Constants.NPPMSG + 72,
+
+        /// <summary>
+        /// BOOL NPPM_ISMENUHIDDEN(0, 0)
+        /// returned value : TRUE if menu is hidden, otherwise FALSE
+        /// </summary>
+        NPPM_ISMENUHIDDEN = Constants.NPPMSG + 73,
+
+        /// <summary>
+        /// BOOL NPPM_HIDESTATUSBAR(0, BOOL hideOrNot)
+        /// if hideOrNot is set as TRUE then STATUSBAR will be hidden
+        /// otherwise it'll be shown.
+        /// return value : the old status value
+        /// </summary>
+        NPPM_HIDESTATUSBAR = Constants.NPPMSG + 74,
+
+        /// <summary>
+        /// BOOL NPPM_ISSTATUSBARHIDDEN(0, 0)
+        /// returned value : TRUE if STATUSBAR is hidden, otherwise FALSE
+        /// </summary>
+        NPPM_ISSTATUSBARHIDDEN = Constants.NPPMSG + 75,
+
+        /// <summary>
+        /// BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey *sk)
+        /// get your plugin command current mapped shortcut into sk via cmdID
+        /// You may need it after getting NPPN_READY notification
+        /// returned value : TRUE if this function call is successful and shorcut is enable, otherwise FALSE
+        /// </summary>
+        NPPM_GETSHORTCUTBYCMDID = Constants.NPPMSG + 76,
+
+        /// <summary>
+        /// BOOL NPPM_DOOPEN(0, const TCHAR *fullPathName2Open)
+        /// fullPathName2Open indicates the full file path name to be opened.
+        /// The return value is TRUE (1) if the operation is successful, otherwise FALSE (0).
+        /// </summary>
+        NPPM_DOOPEN = Constants.NPPMSG + 77,
+
+        /// <summary>
+        /// BOOL NPPM_SAVECURRENTFILEAS (BOOL asCopy, const TCHAR* filename)
+        /// </summary>
+        NPPM_SAVECURRENTFILEAS = Constants.NPPMSG + 78,
+
+        /// <summary>
+        /// INT NPPM_GETCURRENTNATIVELANGENCODING(0, 0)
+        /// returned value : the current native language enconding
+        /// </summary>
+        NPPM_GETCURRENTNATIVELANGENCODING = Constants.NPPMSG + 79,
+
+        /// <summary>
+        /// returns TRUE if NPPM_ALLOCATECMDID is supported
+        /// Use to identify if subclassing is necessary
+        /// </summary>
+        NPPM_ALLOCATESUPPORTED = Constants.NPPMSG + 80,
+
+        /// <summary>
+        /// BOOL NPPM_ALLOCATECMDID(int numberRequested, int* startNumber)
+        /// sets startNumber to the initial command ID if successful
+        /// Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful
+        /// </summary>
+        NPPM_ALLOCATECMDID = Constants.NPPMSG + 81,
+
+        /// <summary>
+        /// BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber)
+        /// sets startNumber to the initial command ID if successful
+        /// Allocates a marker number to a plugin
+        /// Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful
+        /// </summary>
+        NPPM_ALLOCATEMARKER = Constants.NPPMSG + 82,
+
+        /// <summary>
+        /// INT NPPM_GETLANGUAGENAME(int langType, TCHAR *langName)
+        /// Get programing language name from the given language type (LangType)
+        /// Return value is the number of copied character / number of character to copy (\0 is not included)
+        /// You should call this function 2 times - the first time you pass langName as NULL to get the number of characters to copy.
+        /// You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGENAME function the 2nd time
+        /// by passing allocated buffer as argument langName
+        /// </summary>
+        NPPM_GETLANGUAGENAME = Constants.NPPMSG + 83,
+
+        /// <summary>
+        /// INT NPPM_GETLANGUAGEDESC(int langType, TCHAR *langDesc)
+        /// Get programing language short description from the given language type (LangType)
+        /// Return value is the number of copied character / number of character to copy (\0 is not included)
+        /// You should call this function 2 times - the first time you pass langDesc as NULL to get the number of characters to copy.
+        /// You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time
+        /// by passing allocated buffer as argument langDesc
+        /// </summary>
+        NPPM_GETLANGUAGEDESC = Constants.NPPMSG + 84,
+
+        /// <summary>
+        /// VOID NPPM_ISDOCSWITCHERSHOWN(0, BOOL toShowOrNot)
+        /// Send this message to show or hide doc switcher.
+        /// if toShowOrNot is TRUE then show doc switcher, otherwise hide it.
+        /// </summary>
+        NPPM_SHOWDOCSWITCHER = Constants.NPPMSG + 85,
+
+        /// <summary>
+        /// BOOL NPPM_ISDOCSWITCHERSHOWN(0, 0)
+        /// Check to see if doc switcher is shown.
+        /// </summary>
+        NPPM_ISDOCSWITCHERSHOWN = Constants.NPPMSG + 86,
+
+        /// <summary>
+        /// BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0)
+        /// Check to see if loading plugins from "%APPDATA%\Notepad++\plugins" is allowed.
+        /// </summary>
+        NPPM_GETAPPDATAPLUGINSALLOWED = Constants.NPPMSG + 87,
+
+        /// <summary>
+        /// INT NPPM_GETCURRENTVIEW(0, 0)
+        /// Return: current edit view of Notepad++. Only 2 possible values: 0 = Main, 1 = Secondary
+        /// </summary>
+        NPPM_GETCURRENTVIEW = Constants.NPPMSG + 88,
+
+        /// <summary>
+        /// VOID NPPM_DOCSWITCHERDISABLECOLUMN(0, BOOL disableOrNot)
+        /// Disable or enable extension column of doc switcher
+        /// </summary>
+        NPPM_DOCSWITCHERDISABLECOLUMN = Constants.NPPMSG + 89,
+
+        /// <summary>
+        /// INT NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0)
+        /// Return: current editor default foreground color. You should convert the returned value in COLORREF
+        /// </summary>
+        NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR = Constants.NPPMSG + 90,
+
+        /// <summary>
+        /// INT NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR(0, 0)
+        /// Return: current editor default background color. You should convert the returned value in COLORREF
+        /// </summary>
+        NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR = Constants.NPPMSG + 91,
+
+        /// <summary>
+        /// VOID NPPM_SETSMOOTHFONT(0, BOOL setSmoothFontOrNot)
+        /// </summary>
+        NPPM_SETSMOOTHFONT = Constants.NPPMSG + 92,
+
+        /// <summary>
+        /// VOID NPPM_SETEDITORBORDEREDGE(0, BOOL withEditorBorderEdgeOrNot)
+        /// </summary>
+        NPPM_SETEDITORBORDEREDGE = Constants.NPPMSG + 93,
+
+        /// <summary>
+        /// VOID NPPM_SAVEFILE(0, const TCHAR *fileNameToSave)
+        /// </summary>
+        NPPM_SAVEFILE = Constants.NPPMSG + 94,
+
+        RUNCOMMAND_USER = Constants.WM_USER + 3000,
+        NPPM_GETFULLCURRENTPATH = RUNCOMMAND_USER + FULL_CURRENT_PATH,
+        NPPM_GETCURRENTDIRECTORY = RUNCOMMAND_USER + CURRENT_DIRECTORY,
+        NPPM_GETFILENAME = RUNCOMMAND_USER + FILE_NAME,
+        NPPM_GETNAMEPART = RUNCOMMAND_USER + NAME_PART,
+        NPPM_GETEXTPART = RUNCOMMAND_USER + EXT_PART,
+        NPPM_GETCURRENTWORD = RUNCOMMAND_USER + CURRENT_WORD,
+        /// <summary>
+        /// BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str)
+        /// where str is the allocated TCHAR array,
+        ///	     strLen is the allocated array size
+        /// The return value is TRUE when get generic_string operation success
+        /// Otherwise (allocated array size is too small) FALSE
+        /// </summary>
+        NPPM_GETNPPDIRECTORY = RUNCOMMAND_USER + NPP_DIRECTORY,
+
+        /// <summary>
+        /// INT NPPM_GETCURRENTLINE(0, 0)
+        /// return the caret current position line
+        /// </summary>
+        NPPM_GETCURRENTLINE = RUNCOMMAND_USER + CURRENT_LINE,
+
+        /// <summary>
+        /// INT NPPM_GETCURRENTCOLUMN(0, 0)
+        /// return the caret current position column
+        /// </summary>
+        NPPM_GETCURRENTCOLUMN = RUNCOMMAND_USER + CURRENT_COLUMN,
+
+        VAR_NOT_RECOGNIZED = 0,
+        FULL_CURRENT_PATH = 1,
+        CURRENT_DIRECTORY = 2,
+        FILE_NAME = 3,
+        NAME_PART = 4,
+        EXT_PART = 5,
+        CURRENT_WORD = 6,
+        NPP_DIRECTORY = 7,
+        CURRENT_LINE = 8,
+        CURRENT_COLUMN = 9,
+
+        /// <summary>
+        /// To notify plugins that all the procedures of launchment of notepad++ are done.
+        ///scnNotification->nmhdr.code = NPPN_READY;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = 0;
+        /// </summary>
+        NPPN_FIRST = 1000,
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_READY;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = 0;
+        /// </summary>
+        NPPN_READY = NPPN_FIRST + 1,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_TB_MODIFICATION;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = 0;
+        /// </summary>
+        NPPN_TBMODIFICATION = NPPN_FIRST + 2,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILEBEFORECLOSE;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILEBEFORECLOSE = NPPN_FIRST + 3,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILEOPENED;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILEOPENED = NPPN_FIRST + 4,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILECLOSED;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILECLOSED = NPPN_FIRST + 5,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILEBEFOREOPEN = NPPN_FIRST + 6,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILEBEFORESAVE = NPPN_FIRST + 7,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILESAVED;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILESAVED = NPPN_FIRST + 8,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_SHUTDOWN;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = 0;
+        /// </summary>
+        NPPN_SHUTDOWN = NPPN_FIRST + 9,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_BUFFERACTIVATED;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = activatedBufferID;
+        /// </summary>
+        NPPN_BUFFERACTIVATED = NPPN_FIRST + 10,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_LANGCHANGED;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = currentBufferID;
+        /// </summary>
+        NPPN_LANGCHANGED = NPPN_FIRST + 11,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_WORDSTYLESUPDATED;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = currentBufferID;
+        /// </summary>
+        NPPN_WORDSTYLESUPDATED = NPPN_FIRST + 12,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_SHORTCUTSREMAPPED;
+        ///scnNotification->nmhdr.hwndFrom = ShortcutKeyStructurePointer;
+        ///scnNotification->nmhdr.idFrom = cmdID;
+        ///where ShortcutKeyStructurePointer is pointer of struct ShortcutKey:
+        ///struct ShortcutKey {
+        ///	bool _isCtrl;
+        ///	bool _isAlt;
+        ///	bool _isShift;
+        ///	UCHAR _key;
+        ///};
+        /// </summary>
+        NPPN_SHORTCUTREMAPPED = NPPN_FIRST + 13,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = NULL;
+        /// </summary>
+        NPPN_FILEBEFORELOAD = NPPN_FIRST + 14,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILEOPENFAILED;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILELOADFAILED = NPPN_FIRST + 15,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_READONLYCHANGED;
+        ///scnNotification->nmhdr.hwndFrom = bufferID;
+        ///scnNotification->nmhdr.idFrom = docStatus;
+        /// where bufferID is BufferID
+        ///       docStatus can be combined by DOCSTAUS_READONLY and DOCSTAUS_BUFFERDIRTY
+        /// </summary>
+        NPPN_READONLYCHANGED = NPPN_FIRST + 16,
+
+        DOCSTAUS_READONLY = 1,
+        DOCSTAUS_BUFFERDIRTY = 2,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_DOCORDERCHANGED;
+        ///scnNotification->nmhdr.hwndFrom = newIndex;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_DOCORDERCHANGED = NPPN_FIRST + 17,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_SNAPSHOTDIRTYFILELOADED;
+        ///scnNotification->nmhdr.hwndFrom = NULL;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_SNAPSHOTDIRTYFILELOADED = NPPN_FIRST + 18,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_BEFORESHUTDOWN;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = 0;
+        /// </summary>
+        NPPN_BEFORESHUTDOWN = NPPN_FIRST + 19,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_CANCELSHUTDOWN;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = 0;
+        /// </summary>
+        NPPN_CANCELSHUTDOWN = NPPN_FIRST + 20,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILEBEFORERENAME;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILEBEFORERENAME = NPPN_FIRST + 21,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILERENAMECANCEL;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILERENAMECANCEL = NPPN_FIRST + 22,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILERENAMED;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILERENAMED = NPPN_FIRST + 23,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILEBEFOREDELETE;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILEBEFOREDELETE = NPPN_FIRST + 24,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILEDELETEFAILED;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILEDELETEFAILED = NPPN_FIRST + 25,
+
+        /// <summary>
+        ///scnNotification->nmhdr.code = NPPN_FILEDELETED;
+        ///scnNotification->nmhdr.hwndFrom = hwndNpp;
+        ///scnNotification->nmhdr.idFrom = BufferID;
+        /// </summary>
+        NPPN_FILEDELETED = NPPN_FIRST + 26,
+
+        /* --Autogenerated -- end of section automatically generated from notepad-plus-plus\PowerEditor\src\MISC\PluginsManager\Notepad_plus_msgs.h * */
+    }
+}

+ 100 - 0
NppChnConvPlugin/NppPluginInfrastructure/NotepadPPGateway.cs

@@ -0,0 +1,100 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+
+using System.Text;
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+    public interface INotepadPPGateway
+    {
+        void FileNew();
+
+        string GetCurrentFilePath();
+        unsafe string GetFilePath(int bufferId);
+        void SetCurrentLanguage(LangType language);
+        /// <summary>
+        /// Returns the response from NPPM_GETFILENAME 
+        /// </summary>
+        /// <returns></returns>
+        string GetCurrentFileName();
+        /// <summary>
+        /// Returns the response from NPPM_GETCURRENTDIRECTORY 
+        /// </summary>
+        /// <returns></returns>
+        string GetCurrentDirectory();
+    }
+
+    /// <summary>
+    /// This class holds helpers for sending messages defined in the Msgs_h.cs file. It is at the moment
+    /// incomplete. Please help fill in the blanks.
+    /// </summary>
+    public class NotepadPPGateway : INotepadPPGateway
+    {
+        private const int Unused = 0;
+
+        public void FileNew()
+        {
+            Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_MENUCOMMAND, Unused, NppMenuCmd.IDM_FILE_NEW);
+        }
+
+        /// <summary>
+        /// Returns the response from NPPM_GETCURRENTDIRECTORY 
+        /// </summary>
+        /// <returns></returns>
+        public string GetCurrentDirectory()
+        {
+            StringBuilder path = new StringBuilder(Win32.MAX_PATH);
+            Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETCURRENTDIRECTORY, 0, path);
+            return path.ToString();
+        }
+
+        /// <summary>
+        /// Returns the response from NPPM_GETFILENAME
+        /// </summary>
+        /// <returns></returns>
+        public string GetCurrentFileName()
+        {
+            StringBuilder fileName = new StringBuilder(Win32.MAX_PATH);
+            Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETFILENAME, 0, fileName);
+            return fileName.ToString();
+        }
+
+        /// <summary>
+        /// Gets the path of the current document.
+        /// </summary>
+        public string GetCurrentFilePath()
+        {
+            var path = new StringBuilder(2000);
+            Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_GETFULLCURRENTPATH, 0, path);
+            return path.ToString();
+        }
+
+        /// <summary>
+        /// Gets the path of the current document.
+        /// </summary>
+        public unsafe string GetFilePath(int bufferId)
+        {
+            var path = new StringBuilder(2000);
+            Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_GETFULLPATHFROMBUFFERID, bufferId, path);
+            return path.ToString();
+        }
+
+        public void SetCurrentLanguage(LangType language)
+        {
+            Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_SETCURRENTLANGTYPE, Unused, (int) language);
+        }
+    }
+
+    /// <summary>
+    /// This class holds helpers for sending messages defined in the Resource_h.cs file. It is at the moment
+    /// incomplete. Please help fill in the blanks.
+    /// </summary>
+    class NppResource
+    {
+        private const int Unused = 0;
+
+        public void ClearIndicator()
+        {
+            Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) Resource.NPPM_INTERNAL_CLEARINDICATOR, Unused, Unused);
+        }
+    }
+}

+ 52 - 0
NppChnConvPlugin/NppPluginInfrastructure/NppPluginNETBase.cs

@@ -0,0 +1,52 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+
+using System;
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+    public class PluginBase
+    {
+        public static NppData nppData;
+        public static FuncItems _funcItems = new FuncItems();
+
+        public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer)
+        {
+            SetCommand(index, commandName, functionPointer, new ShortcutKey(), false);
+        }
+
+        public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut)
+        {
+            SetCommand(index, commandName, functionPointer, shortcut, false);
+        }
+
+        public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, bool checkOnInit)
+        {
+            SetCommand(index, commandName, functionPointer, new ShortcutKey(), checkOnInit);
+        }
+
+        public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit)
+        {
+            FuncItem funcItem = new FuncItem();
+            funcItem._cmdID = index;
+            funcItem._itemName = commandName;
+            if (functionPointer != null) funcItem._pFunc = new NppFuncItemDelegate(functionPointer);
+            if (shortcut._key != 0) funcItem._pShKey = shortcut;
+            funcItem._init2Check = checkOnInit;
+            _funcItems.Add(funcItem);
+        }
+
+        public static IntPtr GetCurrentScintilla()
+        {
+            int curScintilla;
+            Win32.SendMessage(nppData._nppHandle, (uint)NppMsg.NPPM_GETCURRENTSCINTILLA, 0, out curScintilla);
+            return (curScintilla == 0) ? nppData._scintillaMainHandle : nppData._scintillaSecondHandle;
+        }
+
+        private static readonly Func<IScintillaGateway> gatewayFactory = () => new ScintillaGateway(GetCurrentScintilla());
+
+        public static Func<IScintillaGateway> GetGatewayFactory()
+        {
+            return gatewayFactory;
+        }
+    }
+}

+ 192 - 0
NppChnConvPlugin/NppPluginInfrastructure/NppPluginNETHelper.cs

@@ -0,0 +1,192 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Windows.Forms;
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+    [StructLayout(LayoutKind.Sequential)]
+    public struct NppData
+    {
+        public IntPtr _nppHandle;
+        public IntPtr _scintillaMainHandle;
+        public IntPtr _scintillaSecondHandle;
+    }
+
+    public delegate void NppFuncItemDelegate();
+
+    [StructLayout(LayoutKind.Sequential)]
+    public struct ShortcutKey
+    {
+        public ShortcutKey(bool isCtrl, bool isAlt, bool isShift, Keys key)
+        {
+            // the types 'bool' and 'char' have a size of 1 byte only!
+            _isCtrl = Convert.ToByte(isCtrl);
+            _isAlt = Convert.ToByte(isAlt);
+            _isShift = Convert.ToByte(isShift);
+            _key = Convert.ToByte(key);
+        }
+        public byte _isCtrl;
+        public byte _isAlt;
+        public byte _isShift;
+        public byte _key;
+    }
+
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+    public struct FuncItem
+    {
+        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
+        public string _itemName;
+        public NppFuncItemDelegate _pFunc;
+        public int _cmdID;
+        public bool _init2Check;
+        public ShortcutKey _pShKey;
+    }
+
+    public class FuncItems : IDisposable
+    {
+        List<FuncItem> _funcItems;
+        int _sizeFuncItem;
+        List<IntPtr> _shortCutKeys;
+        IntPtr _nativePointer;
+        bool _disposed = false;
+
+        public FuncItems()
+        {
+            _funcItems = new List<FuncItem>();
+            _sizeFuncItem = Marshal.SizeOf(typeof(FuncItem));
+            _shortCutKeys = new List<IntPtr>();
+        }
+
+        [DllImport("kernel32")]
+        static extern void RtlMoveMemory(IntPtr Destination, IntPtr Source, int Length);
+        public void Add(FuncItem funcItem)
+        {
+            int oldSize = _funcItems.Count * _sizeFuncItem;
+            _funcItems.Add(funcItem);
+            int newSize = _funcItems.Count * _sizeFuncItem;
+            IntPtr newPointer = Marshal.AllocHGlobal(newSize);
+
+            if (_nativePointer != IntPtr.Zero)
+            {
+                RtlMoveMemory(newPointer, _nativePointer, oldSize);
+                Marshal.FreeHGlobal(_nativePointer);
+            }
+            IntPtr ptrPosNewItem = (IntPtr)(newPointer.ToInt64() + oldSize);
+            byte[] aB = Encoding.Unicode.GetBytes(funcItem._itemName + "\0");
+            Marshal.Copy(aB, 0, ptrPosNewItem, aB.Length);
+            ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 128);
+            IntPtr p = (funcItem._pFunc != null) ? Marshal.GetFunctionPointerForDelegate(funcItem._pFunc) : IntPtr.Zero;
+            Marshal.WriteIntPtr(ptrPosNewItem, p);
+            ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + IntPtr.Size);
+            Marshal.WriteInt32(ptrPosNewItem, funcItem._cmdID);
+            ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 4);
+            Marshal.WriteInt32(ptrPosNewItem, Convert.ToInt32(funcItem._init2Check));
+            ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 4);
+            if (funcItem._pShKey._key != 0)
+            {
+                IntPtr newShortCutKey = Marshal.AllocHGlobal(4);
+                Marshal.StructureToPtr(funcItem._pShKey, newShortCutKey, false);
+                Marshal.WriteIntPtr(ptrPosNewItem, newShortCutKey);
+            }
+            else Marshal.WriteIntPtr(ptrPosNewItem, IntPtr.Zero);
+
+            _nativePointer = newPointer;
+        }
+
+        public void RefreshItems()
+        {
+            IntPtr ptrPosItem = _nativePointer;
+            for (int i = 0; i < _funcItems.Count; i++)
+            {
+                FuncItem updatedItem = new FuncItem();
+                updatedItem._itemName = _funcItems[i]._itemName;
+                ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 128);
+                updatedItem._pFunc = _funcItems[i]._pFunc;
+                ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + IntPtr.Size);
+                updatedItem._cmdID = Marshal.ReadInt32(ptrPosItem);
+                ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 4);
+                updatedItem._init2Check = _funcItems[i]._init2Check;
+                ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 4);
+                updatedItem._pShKey = _funcItems[i]._pShKey;
+                ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + IntPtr.Size);
+
+                _funcItems[i] = updatedItem;
+            }
+        }
+
+        public IntPtr NativePointer { get { return _nativePointer; } }
+        public List<FuncItem> Items { get { return _funcItems; } }
+
+        public void Dispose()
+        {
+            if (!_disposed)
+            {
+                foreach (IntPtr ptr in _shortCutKeys) Marshal.FreeHGlobal(ptr);
+                if (_nativePointer != IntPtr.Zero) Marshal.FreeHGlobal(_nativePointer);
+                _disposed = true;
+            }
+        }
+        ~FuncItems()
+        {
+            Dispose();
+        }
+    }
+
+
+    public enum winVer
+    {
+        WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K,
+        WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10
+    }
+
+
+    [Flags]
+    public enum DockMgrMsg : uint
+    {
+        IDB_CLOSE_DOWN = 137,
+        IDB_CLOSE_UP                    = 138,
+        IDD_CONTAINER_DLG               = 139,
+
+        IDC_TAB_CONT                    = 1027,
+        IDC_CLIENT_TAB                  = 1028,
+        IDC_BTN_CAPTION                 = 1050,
+
+        DMM_MSG                         = 0x5000,
+            DMM_CLOSE                   = (DMM_MSG + 1),
+            DMM_DOCK                    = (DMM_MSG + 2),
+            DMM_FLOAT                   = (DMM_MSG + 3),
+            DMM_DOCKALL                 = (DMM_MSG + 4),
+            DMM_FLOATALL                = (DMM_MSG + 5),
+            DMM_MOVE                    = (DMM_MSG + 6),
+            DMM_UPDATEDISPINFO          = (DMM_MSG + 7),
+            DMM_GETIMAGELIST            = (DMM_MSG + 8),
+            DMM_GETICONPOS              = (DMM_MSG + 9),
+            DMM_DROPDATA                = (DMM_MSG + 10),
+            DMM_MOVE_SPLITTER            = (DMM_MSG + 11),
+            DMM_CANCEL_MOVE                = (DMM_MSG + 12),
+            DMM_LBUTTONUP                = (DMM_MSG + 13),
+
+        DMN_FIRST = 1050,
+            DMN_CLOSE                    = (DMN_FIRST + 1),
+            //nmhdr.Code = DWORD(DMN_CLOSE, 0));
+            //nmhdr.hwndFrom = hwndNpp;
+            //nmhdr.IdFrom = ctrlIdNpp;
+
+            DMN_DOCK                    = (DMN_FIRST + 2),
+            DMN_FLOAT                    = (DMN_FIRST + 3)
+            //nmhdr.Code = DWORD(DMN_XXX, int newContainer);
+            //nmhdr.hwndFrom = hwndNpp;
+            //nmhdr.IdFrom = ctrlIdNpp;
+    }
+
+    [StructLayout(LayoutKind.Sequential)]
+    public struct toolbarIcons
+    {
+        public IntPtr hToolbarBmp;
+        public IntPtr hToolbarIcon;
+    }
+}

+ 306 - 0
NppChnConvPlugin/NppPluginInfrastructure/Preference_h.cs

@@ -0,0 +1,306 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+//
+// This file should stay in sync with the CPP project file
+// "notepad-plus-plus/scintilla/include/Scintilla.iface"
+// found at
+// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/include/Scintilla.iface
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+	public enum Preference
+	{
+		/* ++Autogenerated -- start of section automatically generated from preference_rc.h */
+
+        IDD_PREFERENCE_BOX = 6000,
+        IDC_BUTTON_CLOSE = IDD_PREFERENCE_BOX + 1,
+        IDC_LIST_DLGTITLE = IDD_PREFERENCE_BOX + 2,
+
+        IDD_PREFERENCE_BAR_BOX = 6100,
+        IDC_TOOLBAR_GB_STATIC = IDD_PREFERENCE_BAR_BOX + 1,
+        IDC_CHECK_HIDE = IDD_PREFERENCE_BAR_BOX + 2,
+        IDC_RADIO_SMALLICON = IDD_PREFERENCE_BAR_BOX + 3,
+        IDC_RADIO_BIGICON = IDD_PREFERENCE_BAR_BOX + 4,
+        IDC_RADIO_STANDARD = IDD_PREFERENCE_BAR_BOX + 5,
+
+        IDC_TABBAR_GB_STATIC = IDD_PREFERENCE_BAR_BOX + 6,
+        IDC_CHECK_REDUCE = IDD_PREFERENCE_BAR_BOX + 7,
+        IDC_CHECK_LOCK = IDD_PREFERENCE_BAR_BOX + 8,
+        IDC_CHECK_DRAWINACTIVE = IDD_PREFERENCE_BAR_BOX + 9,
+        IDC_CHECK_ORANGE = IDD_PREFERENCE_BAR_BOX + 10,
+        IDC_CHECK_SHOWSTATUSBAR = IDD_PREFERENCE_BAR_BOX + 11,
+        IDC_CHECK_ENABLETABCLOSE = IDD_PREFERENCE_BAR_BOX + 12,
+        IDC_CHECK_DBCLICK2CLOSE = IDD_PREFERENCE_BAR_BOX + 13,
+        IDC_CHECK_ENABLEDOCSWITCHER = IDD_PREFERENCE_BAR_BOX + 14,
+        IDC_CHECK_MAINTAININDENT = IDD_PREFERENCE_BAR_BOX + 15,
+        IDC_CHECK_KEEPINSAMEDIR = IDD_PREFERENCE_BAR_BOX + 16,
+        IDC_CHECK_STYLEMRU = IDD_PREFERENCE_BAR_BOX + 17,
+        IDC_CHECK_TAB_HIDE = IDD_PREFERENCE_BAR_BOX + 18,
+        IDC_CHECK_TAB_MULTILINE = IDD_PREFERENCE_BAR_BOX + 19,
+        IDC_CHECK_TAB_VERTICAL = IDD_PREFERENCE_BAR_BOX + 20,
+
+        IDC_CHECK_HIDEMENUBAR = IDD_PREFERENCE_BAR_BOX + 22,
+        IDC_LOCALIZATION_GB_STATIC = IDD_PREFERENCE_BAR_BOX + 23,
+        IDC_COMBO_LOCALIZATION = IDD_PREFERENCE_BAR_BOX + 24,
+        IDC_DOCSWITCH_GB_STATIC = IDD_PREFERENCE_BAR_BOX + 25,
+        IDC_CHECK_DOCSWITCH = IDD_PREFERENCE_BAR_BOX + 26,
+        IDC_CHECK_DOCSWITCH_NOEXTCOLUMN = IDD_PREFERENCE_BAR_BOX + 27,
+
+        IDD_PREFERENCE_MULTIINSTANCE_BOX = 6150,
+        IDC_MULTIINST_GB_STATIC = IDD_PREFERENCE_MULTIINSTANCE_BOX + 1,
+        IDC_SESSIONININST_RADIO = IDD_PREFERENCE_MULTIINSTANCE_BOX + 2,
+        IDC_MULTIINST_RADIO = IDD_PREFERENCE_MULTIINSTANCE_BOX + 3,
+        IDC_MONOINST_RADIO = IDD_PREFERENCE_MULTIINSTANCE_BOX + 4,
+        IDD_STATIC_RESTARTNOTE = IDD_PREFERENCE_MULTIINSTANCE_BOX + 5,
+
+        IDD_PREFERENCE_MARGEIN_BOX = 6200,
+        IDC_FMS_GB_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 1,
+        IDC_RADIO_SIMPLE = IDD_PREFERENCE_MARGEIN_BOX + 2,
+        IDC_RADIO_ARROW = IDD_PREFERENCE_MARGEIN_BOX + 3,
+        IDC_RADIO_CIRCLE = IDD_PREFERENCE_MARGEIN_BOX + 4,
+        IDC_RADIO_BOX = IDD_PREFERENCE_MARGEIN_BOX + 5,
+
+        IDC_CHECK_LINENUMBERMARGE = IDD_PREFERENCE_MARGEIN_BOX + 6,
+        IDC_CHECK_BOOKMARKMARGE = IDD_PREFERENCE_MARGEIN_BOX + 7,
+
+        IDC_CHECK_SHOWVERTICALEDGE = IDD_PREFERENCE_MARGEIN_BOX + 8,
+        IDC_NBCOLONE_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 9,
+        IDC_COLONENUMBER_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 10,
+
+        IDC_VES_GB_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 11,
+        IDC_RADIO_LNMODE = IDD_PREFERENCE_MARGEIN_BOX + 12,
+        IDC_RADIO_BGMODE = IDD_PREFERENCE_MARGEIN_BOX + 13,
+        IDC_CHECK_CURRENTLINEHILITE = IDD_PREFERENCE_MARGEIN_BOX + 14,
+        IDC_CHECK_SMOOTHFONT = IDD_PREFERENCE_MARGEIN_BOX + 15,
+
+        IDC_CARETSETTING_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 16,
+        IDC_WIDTH_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 17,
+        IDC_WIDTH_COMBO = IDD_PREFERENCE_MARGEIN_BOX + 18,
+        IDC_BLINKRATE_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 19,
+        IDC_CARETBLINKRATE_SLIDER = IDD_PREFERENCE_MARGEIN_BOX + 20,
+        IDC_CARETBLINKRATE_F_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 21,
+        IDC_CARETBLINKRATE_S_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 22,
+        IDC_CHECK_DOCCHANGESTATEMARGE = IDD_PREFERENCE_MARGEIN_BOX + 23,
+        IDC_MULTISELECTION_GB_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 24,
+        IDC_CHECK_MULTISELECTION = IDD_PREFERENCE_MARGEIN_BOX + 25,
+
+        IDC_RADIO_FOLDMARGENONE = IDD_PREFERENCE_MARGEIN_BOX + 26,
+
+        IDC_LW_GB_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 27,
+        IDC_RADIO_LWDEF = IDD_PREFERENCE_MARGEIN_BOX + 28,
+        IDC_RADIO_LWALIGN = IDD_PREFERENCE_MARGEIN_BOX + 29,
+        IDC_RADIO_LWINDENT = IDD_PREFERENCE_MARGEIN_BOX + 30,
+
+        IDC_BORDERWIDTH_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 31,
+        IDC_BORDERWIDTHVAL_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 32,
+        IDC_BORDERWIDTH_SLIDER = IDD_PREFERENCE_MARGEIN_BOX + 33,
+        IDC_CHECK_DISABLEADVANCEDSCROLL = IDD_PREFERENCE_MARGEIN_BOX + 34,
+        IDC_CHECK_NOEDGE = IDD_PREFERENCE_MARGEIN_BOX + 35,
+
+        IDD_PREFERENCE_DELIMITERSETTINGS_BOX = 6250,
+        IDC_DELIMITERSETTINGS_GB_STATIC = IDD_PREFERENCE_DELIMITERSETTINGS_BOX + 1,
+        IDD_STATIC_OPENDELIMITER = IDD_PREFERENCE_DELIMITERSETTINGS_BOX + 2,
+        IDC_EDIT_OPENDELIMITER = IDD_PREFERENCE_DELIMITERSETTINGS_BOX + 3,
+        IDC_EDIT_CLOSEDELIMITER = IDD_PREFERENCE_DELIMITERSETTINGS_BOX + 4,
+        IDD_STATIC_CLOSEDELIMITER = IDD_PREFERENCE_DELIMITERSETTINGS_BOX + 5,
+        IDD_SEVERALLINEMODEON_CHECK = IDD_PREFERENCE_DELIMITERSETTINGS_BOX + 6,
+        IDD_STATIC_BLABLA = IDD_PREFERENCE_DELIMITERSETTINGS_BOX + 7,
+        IDD_STATIC_BLABLA2NDLINE = IDD_PREFERENCE_DELIMITERSETTINGS_BOX + 8,
+
+        IDD_PREFERENCE_SETTINGSONCLOUD_BOX = 6260,
+        IDC_SETTINGSONCLOUD_WARNING_STATIC = IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 1,
+        IDC_SETTINGSONCLOUD_GB_STATIC = IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 2,
+        IDC_NOCLOUD_RADIO = IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 3,
+
+        IDC_WITHCLOUD_RADIO = IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 7,
+        IDC_CLOUDPATH_EDIT = IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 8,
+        IDD_CLOUDPATH_BROWSE_BUTTON = IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 9,
+
+        IDD_PREFERENCE_SETTING_BOX = 6300,
+        IDC_TABSETTING_GB_STATIC = IDD_PREFERENCE_SETTING_BOX + 1,
+        IDC_CHECK_REPLACEBYSPACE = IDD_PREFERENCE_SETTING_BOX + 2,
+        IDC_TABSIZE_STATIC = IDD_PREFERENCE_SETTING_BOX + 3,
+        IDC_HISTORY_GB_STATIC = IDD_PREFERENCE_SETTING_BOX + 4,
+        IDC_CHECK_DONTCHECKHISTORY = IDD_PREFERENCE_SETTING_BOX + 5,
+        IDC_MAXNBFILE_STATIC = IDD_PREFERENCE_SETTING_BOX + 6,
+        IDC_CHECK_FILEAUTODETECTION = IDD_PREFERENCE_SETTING_BOX + 7,
+        IDC_CHECK_MIN2SYSTRAY = IDD_PREFERENCE_SETTING_BOX + 8,
+        IDC_CHECK_REMEMBERSESSION = IDD_PREFERENCE_SETTING_BOX + 9,
+        IDC_TABSIZEVAL_STATIC = IDD_PREFERENCE_SETTING_BOX + 10,
+        IDC_MAXNBFILEVAL_STATIC = IDD_PREFERENCE_SETTING_BOX + 11,
+        IDC_FILEAUTODETECTION_STATIC = IDD_PREFERENCE_SETTING_BOX + 12,
+        IDC_CHECK_UPDATESILENTLY = IDD_PREFERENCE_SETTING_BOX + 13,
+
+        IDC_RADIO_BKNONE = IDD_PREFERENCE_SETTING_BOX + 15,
+        IDC_RADIO_BKSIMPLE = IDD_PREFERENCE_SETTING_BOX + 16,
+        IDC_RADIO_BKVERBOSE = IDD_PREFERENCE_SETTING_BOX + 17,
+        IDC_CLICKABLELINK_STATIC = IDD_PREFERENCE_SETTING_BOX + 18,
+        IDC_CHECK_CLICKABLELINK_ENABLE = IDD_PREFERENCE_SETTING_BOX + 19,
+        IDC_CHECK_CLICKABLELINK_NOUNDERLINE = IDD_PREFERENCE_SETTING_BOX + 20,
+        IDC_EDIT_SESSIONFILEEXT = IDD_PREFERENCE_SETTING_BOX + 21,
+        IDC_SESSIONFILEEXT_STATIC = IDD_PREFERENCE_SETTING_BOX + 22,
+        IDC_CHECK_AUTOUPDATE = IDD_PREFERENCE_SETTING_BOX + 23,
+        IDC_DOCUMENTSWITCHER_STATIC = IDD_PREFERENCE_SETTING_BOX + 24,
+        IDC_CHECK_UPDATEGOTOEOF = IDD_PREFERENCE_SETTING_BOX + 25,
+        IDC_CHECK_ENABLSMARTHILITE = IDD_PREFERENCE_SETTING_BOX + 26,
+        IDC_CHECK_ENABLTAGSMATCHHILITE = IDD_PREFERENCE_SETTING_BOX + 27,
+        IDC_CHECK_ENABLTAGATTRHILITE = IDD_PREFERENCE_SETTING_BOX + 28,
+        IDC_TAGMATCHEDHILITE_STATIC = IDD_PREFERENCE_SETTING_BOX + 29,
+        IDC_CHECK_HIGHLITENONEHTMLZONE = IDD_PREFERENCE_SETTING_BOX + 30,
+        IDC_CHECK_SHORTTITLE = IDD_PREFERENCE_SETTING_BOX + 31,
+        IDC_CHECK_SMARTHILITECASESENSITIVE = IDD_PREFERENCE_SETTING_BOX + 32,
+        IDC_SMARTHILITING_STATIC = IDD_PREFERENCE_SETTING_BOX + 33,
+        IDC_CHECK_DETECTENCODING = IDD_PREFERENCE_SETTING_BOX + 34,
+        IDC_CHECK_BACKSLASHISESCAPECHARACTERFORSQL = IDD_PREFERENCE_SETTING_BOX + 35,
+        IDC_EDIT_WORKSPACEFILEEXT = IDD_PREFERENCE_SETTING_BOX + 36,
+        IDC_WORKSPACEFILEEXT_STATIC = IDD_PREFERENCE_SETTING_BOX + 37,
+
+        IDC_PREFERENCE_OFFSET_FLS = 40,
+        IDC_CHECK_REMEMBEREDITVIEWPERFILE = IDD_PREFERENCE_SETTING_BOX + IDC_PREFERENCE_OFFSET_FLS + 1,
+        IDC_REMEMBEREDITVIEWPERFILE_STATIC = IDD_PREFERENCE_SETTING_BOX + IDC_PREFERENCE_OFFSET_FLS + 2,
+        IDC_EDIT_REMEMBEREDITVIEWPERFILE = IDD_PREFERENCE_SETTING_BOX + IDC_PREFERENCE_OFFSET_FLS + 3,
+
+        IDD_PREFERENCE_NEWDOCSETTING_BOX = 6400,
+        IDC_FORMAT_GB_STATIC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 1,
+        IDC_RADIO_F_WIN = IDD_PREFERENCE_NEWDOCSETTING_BOX + 2,
+        IDC_RADIO_F_UNIX = IDD_PREFERENCE_NEWDOCSETTING_BOX + 3,
+        IDC_RADIO_F_MAC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 4,
+        IDC_ENCODING_STATIC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 5,
+        IDC_RADIO_ANSI = IDD_PREFERENCE_NEWDOCSETTING_BOX + 6,
+        IDC_RADIO_UTF8SANSBOM = IDD_PREFERENCE_NEWDOCSETTING_BOX + 7,
+        IDC_RADIO_UTF8 = IDD_PREFERENCE_NEWDOCSETTING_BOX + 8,
+        IDC_RADIO_UCS2BIG = IDD_PREFERENCE_NEWDOCSETTING_BOX + 9,
+        IDC_RADIO_UCS2SMALL = IDD_PREFERENCE_NEWDOCSETTING_BOX + 10,
+        IDC_DEFAULTLANG_STATIC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 11,
+        IDC_COMBO_DEFAULTLANG = IDD_PREFERENCE_NEWDOCSETTING_BOX + 12,
+        IDC_OPENSAVEDIR_GR_STATIC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 13,
+        IDC_OPENSAVEDIR_FOLLOWCURRENT_RADIO = IDD_PREFERENCE_NEWDOCSETTING_BOX + 14,
+        IDC_OPENSAVEDIR_REMEMBERLAST_RADIO = IDD_PREFERENCE_NEWDOCSETTING_BOX + 15,
+        IDC_OPENSAVEDIR_ALWAYSON_RADIO = IDD_PREFERENCE_NEWDOCSETTING_BOX + 16,
+        IDC_OPENSAVEDIR_ALWAYSON_EDIT = IDD_PREFERENCE_NEWDOCSETTING_BOX + 17,
+        IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON = IDD_PREFERENCE_NEWDOCSETTING_BOX + 18,
+        IDC_NEWDOCUMENT_GR_STATIC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 19,
+        IDC_CHECK_OPENANSIASUTF8 = IDD_PREFERENCE_NEWDOCSETTING_BOX + 20,
+        IDC_RADIO_OTHERCP = IDD_PREFERENCE_NEWDOCSETTING_BOX + 21,
+        IDC_COMBO_OTHERCP = IDD_PREFERENCE_NEWDOCSETTING_BOX + 22,
+        IDC_GP_STATIC_RECENTFILES = IDD_PREFERENCE_NEWDOCSETTING_BOX + 23,
+        IDC_CHECK_INSUBMENU = IDD_PREFERENCE_NEWDOCSETTING_BOX + 24,
+        IDC_RADIO_ONLYFILENAME = IDD_PREFERENCE_NEWDOCSETTING_BOX + 25,
+        IDC_RADIO_FULLFILENAMEPATH = IDD_PREFERENCE_NEWDOCSETTING_BOX + 26,
+        IDC_RADIO_CUSTOMIZELENTH = IDD_PREFERENCE_NEWDOCSETTING_BOX + 27,
+        IDC_CUSTOMIZELENGTHVAL_STATIC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 28,
+        IDC_DISPLAY_STATIC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 29,
+        IDC_OPENSAVEDIR_CHECK_USENEWSTYLESAVEDIALOG = IDD_PREFERENCE_NEWDOCSETTING_BOX + 30,
+
+        IDD_PREFERENCE_DEFAULTDIRECTORY_BOX = 6450,
+        IDD_PREFERENCE_RECENTFILESHISTORY_BOX = 6460,
+
+        IDD_PREFERENCE_LANG_BOX = 6500,
+        IDC_LIST_ENABLEDLANG = IDD_PREFERENCE_LANG_BOX + 1,
+        IDC_LIST_DISABLEDLANG = IDD_PREFERENCE_LANG_BOX + 2,
+        IDC_BUTTON_REMOVE = IDD_PREFERENCE_LANG_BOX + 3,
+        IDC_BUTTON_RESTORE = IDD_PREFERENCE_LANG_BOX + 4,
+        IDC_ENABLEDITEMS_STATIC = IDD_PREFERENCE_LANG_BOX + 5,
+        IDC_DISABLEDITEMS_STATIC = IDD_PREFERENCE_LANG_BOX + 6,
+        IDC_CHECK_LANGMENUCOMPACT = IDD_PREFERENCE_LANG_BOX + 7,
+        IDC_CHECK_LANGMENU_GR_STATIC = IDD_PREFERENCE_LANG_BOX + 8,
+        IDC_LIST_TABSETTNG = IDD_PREFERENCE_LANG_BOX + 9,
+        IDC_CHECK_DEFAULTTABVALUE = IDD_PREFERENCE_LANG_BOX + 10,
+        IDC_GR_TABVALUE_STATIC = IDD_PREFERENCE_LANG_BOX + 11,
+        IDC_TABSIZEVAL_DISABLE_STATIC = IDD_PREFERENCE_LANG_BOX + 12,
+        IDD_PREFERENCE_TABSETTINGS_BOX = 6550,
+
+        IDD_PREFERENCE_PRINT_BOX = 6600,
+        IDC_CHECK_PRINTLINENUM = IDD_PREFERENCE_PRINT_BOX + 1,
+        IDC_COLOUROPT_STATIC = IDD_PREFERENCE_PRINT_BOX + 2,
+        IDC_RADIO_WYSIWYG = IDD_PREFERENCE_PRINT_BOX + 3,
+        IDC_RADIO_INVERT = IDD_PREFERENCE_PRINT_BOX + 4,
+        IDC_RADIO_BW = IDD_PREFERENCE_PRINT_BOX + 5,
+        IDC_RADIO_NOBG = IDD_PREFERENCE_PRINT_BOX + 6,
+        IDC_MARGESETTINGS_STATIC = IDD_PREFERENCE_PRINT_BOX + 7,
+        IDC_EDIT_ML = IDD_PREFERENCE_PRINT_BOX + 8,
+        IDC_EDIT_MT = IDD_PREFERENCE_PRINT_BOX + 9,
+        IDC_EDIT_MR = IDD_PREFERENCE_PRINT_BOX + 10,
+        IDC_EDIT_MB = IDD_PREFERENCE_PRINT_BOX + 11,
+        IDC_ML_STATIC = IDD_PREFERENCE_PRINT_BOX + 12,
+        IDC_MT_STATIC = IDD_PREFERENCE_PRINT_BOX + 13,
+        IDC_MR_STATIC = IDD_PREFERENCE_PRINT_BOX + 14,
+        IDC_MB_STATIC = IDD_PREFERENCE_PRINT_BOX + 15,
+
+        IDD_PREFERENCE_PRINT2_BOX = 6700,
+        IDC_EDIT_HLEFT = IDD_PREFERENCE_PRINT2_BOX + 1,
+        IDC_EDIT_HMIDDLE = IDD_PREFERENCE_PRINT2_BOX + 2,
+        IDC_EDIT_HRIGHT = IDD_PREFERENCE_PRINT2_BOX + 3,
+        IDC_COMBO_HFONTNAME = IDD_PREFERENCE_PRINT2_BOX + 4,
+        IDC_COMBO_HFONTSIZE = IDD_PREFERENCE_PRINT2_BOX + 5,
+        IDC_CHECK_HBOLD = IDD_PREFERENCE_PRINT2_BOX + 6,
+        IDC_CHECK_HITALIC = IDD_PREFERENCE_PRINT2_BOX + 7,
+        IDC_HGB_STATIC = IDD_PREFERENCE_PRINT2_BOX + 8,
+        IDC_HL_STATIC = IDD_PREFERENCE_PRINT2_BOX + 9,
+        IDC_HM_STATIC = IDD_PREFERENCE_PRINT2_BOX + 10,
+        IDC_HR_STATIC = IDD_PREFERENCE_PRINT2_BOX + 11,
+        IDC_EDIT_FLEFT = IDD_PREFERENCE_PRINT2_BOX + 12,
+        IDC_EDIT_FMIDDLE = IDD_PREFERENCE_PRINT2_BOX + 13,
+        IDC_EDIT_FRIGHT = IDD_PREFERENCE_PRINT2_BOX + 14,
+        IDC_COMBO_FFONTNAME = IDD_PREFERENCE_PRINT2_BOX + 15,
+        IDC_COMBO_FFONTSIZE = IDD_PREFERENCE_PRINT2_BOX + 16,
+        IDC_CHECK_FBOLD = IDD_PREFERENCE_PRINT2_BOX + 17,
+        IDC_CHECK_FITALIC = IDD_PREFERENCE_PRINT2_BOX + 18,
+        IDC_FGB_STATIC = IDD_PREFERENCE_PRINT2_BOX + 19,
+        IDC_FL_STATIC = IDD_PREFERENCE_PRINT2_BOX + 20,
+        IDC_FM_STATIC = IDD_PREFERENCE_PRINT2_BOX + 21,
+        IDC_FR_STATIC = IDD_PREFERENCE_PRINT2_BOX + 22,
+        IDC_BUTTON_ADDVAR = IDD_PREFERENCE_PRINT2_BOX + 23,
+        IDC_COMBO_VARLIST = IDD_PREFERENCE_PRINT2_BOX + 24,
+        IDC_VAR_STATIC = IDD_PREFERENCE_PRINT2_BOX + 25,
+        IDC_VIEWPANEL_STATIC = IDD_PREFERENCE_PRINT2_BOX + 26,
+        IDC_WHICHPART_STATIC = IDD_PREFERENCE_PRINT2_BOX + 27,
+        IDC_HEADERFPPTER_GR_STATIC = IDD_PREFERENCE_PRINT2_BOX + 28,
+
+        IDD_PREFERENCE_BACKUP_BOX = 6800,
+        IDC_BACKUPDIR_GRP_STATIC = IDD_PREFERENCE_BACKUP_BOX + 1,
+        IDC_BACKUPDIR_CHECK = IDD_PREFERENCE_BACKUP_BOX + 2,
+        IDD_BACKUPDIR_STATIC = IDD_PREFERENCE_BACKUP_BOX + 3,
+        IDC_BACKUPDIR_USERCUSTOMDIR_GRPSTATIC = IDD_PREFERENCE_BACKUP_BOX + 4,
+        IDC_BACKUPDIR_EDIT = IDD_PREFERENCE_BACKUP_BOX + 5,
+        IDD_BACKUPDIR_BROWSE_BUTTON = IDD_PREFERENCE_BACKUP_BOX + 6,
+        IDD_AUTOC_GRPSTATIC = IDD_PREFERENCE_BACKUP_BOX + 7,
+        IDD_AUTOC_ENABLECHECK = IDD_PREFERENCE_BACKUP_BOX + 8,
+        IDD_AUTOC_FUNCRADIO = IDD_PREFERENCE_BACKUP_BOX + 9,
+        IDD_AUTOC_WORDRADIO = IDD_PREFERENCE_BACKUP_BOX + 10,
+        IDD_AUTOC_STATIC_FROM = IDD_PREFERENCE_BACKUP_BOX + 11,
+        IDD_AUTOC_STATIC_N = IDD_PREFERENCE_BACKUP_BOX + 12,
+        IDD_AUTOC_STATIC_CHAR = IDD_PREFERENCE_BACKUP_BOX + 13,
+        IDD_AUTOC_STATIC_NOTE = IDD_PREFERENCE_BACKUP_BOX + 14,
+        IDD_FUNC_CHECK = IDD_PREFERENCE_BACKUP_BOX + 15,
+        IDD_AUTOC_BOTHRADIO = IDD_PREFERENCE_BACKUP_BOX + 16,
+        IDC_BACKUPDIR_RESTORESESSION_GRP_STATIC = IDD_PREFERENCE_BACKUP_BOX + 17,
+        IDC_BACKUPDIR_RESTORESESSION_CHECK = IDD_PREFERENCE_BACKUP_BOX + 18,
+        IDD_BACKUPDIR_RESTORESESSION_STATIC1 = IDD_PREFERENCE_BACKUP_BOX + 19,
+        IDC_BACKUPDIR_RESTORESESSION_EDIT = IDD_PREFERENCE_BACKUP_BOX + 20,
+        IDD_BACKUPDIR_RESTORESESSION_STATIC2 = IDD_PREFERENCE_BACKUP_BOX + 21,
+        IDD_BACKUPDIR_RESTORESESSION_PATHLABEL_STATIC = IDD_PREFERENCE_BACKUP_BOX + 22,
+        IDD_BACKUPDIR_RESTORESESSION_PATH_EDIT = IDD_PREFERENCE_BACKUP_BOX + 23,
+
+        IDD_PREFERENCE_AUTOCOMPLETION_BOX = 6850,
+        IDD_AUTOCINSERT_GRPSTATIC = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 1,
+        IDD_AUTOCPARENTHESES_CHECK = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 2,
+        IDD_AUTOCBRACKET_CHECK = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 3,
+        IDD_AUTOCCURLYBRACKET_CHECK = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 4,
+        IDD_AUTOC_DOUBLEQUOTESCHECK = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 5,
+        IDD_AUTOC_QUOTESCHECK = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 6,
+        IDD_AUTOCTAG_CHECK = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 7,
+        IDC_MACHEDPAIROPEN_STATIC = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 8,
+        IDC_MACHEDPAIRCLOSE_STATIC = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 9,
+        IDC_MACHEDPAIR_STATIC1 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 10,
+        IDC_MACHEDPAIROPEN_EDIT1 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 11,
+        IDC_MACHEDPAIRCLOSE_EDIT1 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 12,
+        IDC_MACHEDPAIR_STATIC2 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 13,
+        IDC_MACHEDPAIROPEN_EDIT2 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 14,
+        IDC_MACHEDPAIRCLOSE_EDIT2 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 15,
+        IDC_MACHEDPAIR_STATIC3 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 16,
+        IDC_MACHEDPAIROPEN_EDIT3 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 17,
+        IDC_MACHEDPAIRCLOSE_EDIT3 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 18,
+
+		/* --Autogenerated -- end of section automatically generated from preference_rc.h */
+	}
+}

+ 345 - 0
NppChnConvPlugin/NppPluginInfrastructure/Resource_h.cs

@@ -0,0 +1,345 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+//
+// This file should stay in sync with the CPP project file
+// "notepad-plus-plus/scintilla/include/Scintilla.iface"
+// found at
+// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/include/Scintilla.iface
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+	public enum Resource
+	{
+		/* ++Autogenerated -- start of section automatically generated from resource.h */
+
+        IDC_STATIC = -1,
+
+        IDI_M30ICON = 100,
+        IDI_CHAMELEON = 101,
+
+        IDR_RT_MANIFEST = 103,
+
+        IDI_NEW_OFF_ICON = 201,
+        IDI_OPEN_OFF_ICON = 202,
+        IDI_CLOSE_OFF_ICON = 203,
+        IDI_CLOSEALL_OFF_ICON = 204,
+        IDI_SAVE_OFF_ICON = 205,
+        IDI_SAVEALL_OFF_ICON = 206,
+        IDI_CUT_OFF_ICON = 207,
+        IDI_COPY_OFF_ICON = 208,
+        IDI_PASTE_OFF_ICON = 209,
+        IDI_UNDO_OFF_ICON = 210,
+        IDI_REDO_OFF_ICON = 211,
+        IDI_FIND_OFF_ICON = 212,
+        IDI_REPLACE_OFF_ICON = 213,
+        IDI_ZOOMIN_OFF_ICON = 214,
+        IDI_ZOOMOUT_OFF_ICON = 215,
+        IDI_VIEW_UD_DLG_OFF_ICON = 216,
+        IDI_PRINT_OFF_ICON = 217,
+        IDI_VIEW_ALL_CHAR_ON_ICON = 218,
+        IDI_VIEW_INDENT_ON_ICON = 219,
+        IDI_VIEW_WRAP_ON_ICON = 220,
+
+        IDI_STARTRECORD_OFF_ICON = 221,
+        IDI_STARTRECORD_ON_ICON = 222,
+        IDI_STARTRECORD_DISABLE_ICON = 223,
+        IDI_STOPRECORD_OFF_ICON = 224,
+        IDI_STOPRECORD_ON_ICON = 225,
+        IDI_STOPRECORD_DISABLE_ICON = 226,
+        IDI_PLAYRECORD_OFF_ICON = 227,
+        IDI_PLAYRECORD_ON_ICON = 228,
+        IDI_PLAYRECORD_DISABLE_ICON = 229,
+        IDI_SAVERECORD_OFF_ICON = 230,
+        IDI_SAVERECORD_ON_ICON = 231,
+        IDI_SAVERECORD_DISABLE_ICON = 232,
+
+        IDI_MMPLAY_DIS_ICON = 233,
+        IDI_MMPLAY_OFF_ICON = 234,
+        IDI_MMPLAY_ON_ICON = 235,
+
+        IDI_NEW_ON_ICON = 301,
+        IDI_OPEN_ON_ICON = 302,
+        IDI_CLOSE_ON_ICON = 303,
+        IDI_CLOSEALL_ON_ICON = 304,
+        IDI_SAVE_ON_ICON = 305,
+        IDI_SAVEALL_ON_ICON = 306,
+        IDI_CUT_ON_ICON = 307,
+        IDI_COPY_ON_ICON = 308,
+        IDI_PASTE_ON_ICON = 309,
+        IDI_UNDO_ON_ICON = 310,
+        IDI_REDO_ON_ICON = 311,
+        IDI_FIND_ON_ICON = 312,
+        IDI_REPLACE_ON_ICON = 313,
+        IDI_ZOOMIN_ON_ICON = 314,
+        IDI_ZOOMOUT_ON_ICON = 315,
+        IDI_VIEW_UD_DLG_ON_ICON = 316,
+        IDI_PRINT_ON_ICON = 317,
+        IDI_VIEW_ALL_CHAR_OFF_ICON = 318,
+        IDI_VIEW_INDENT_OFF_ICON = 319,
+        IDI_VIEW_WRAP_OFF_ICON = 320,
+
+        IDI_SAVE_DISABLE_ICON = 403,
+        IDI_SAVEALL_DISABLE_ICON = 404,
+
+        IDI_CUT_DISABLE_ICON = 407,
+        IDI_COPY_DISABLE_ICON = 408,
+        IDI_PASTE_DISABLE_ICON = 409,
+        IDI_UNDO_DISABLE_ICON = 410,
+        IDI_REDO_DISABLE_ICON = 411,
+        IDI_DELETE_ICON = 412,
+
+        IDI_SYNCV_OFF_ICON = 413,
+        IDI_SYNCV_ON_ICON = 414,
+        IDI_SYNCV_DISABLE_ICON = 415,
+
+        IDI_SYNCH_OFF_ICON = 416,
+        IDI_SYNCH_ON_ICON = 417,
+        IDI_SYNCH_DISABLE_ICON = 418,
+
+        IDI_SAVED_ICON = 501,
+        IDI_UNSAVED_ICON = 502,
+        IDI_READONLY_ICON = 503,
+        IDI_FIND_RESULT_ICON = 504,
+
+        IDI_PROJECT_WORKSPACE = 601,
+        IDI_PROJECT_WORKSPACEDIRTY = 602,
+        IDI_PROJECT_PROJECT = 603,
+        IDI_PROJECT_FOLDEROPEN = 604,
+        IDI_PROJECT_FOLDERCLOSE = 605,
+        IDI_PROJECT_FILE = 606,
+        IDI_PROJECT_FILEINVALID = 607,
+        IDI_FB_ROOTOPEN = 608,
+        IDI_FB_ROOTCLOSE = 609,
+
+        IDI_FUNCLIST_ROOT = 620,
+        IDI_FUNCLIST_NODE = 621,
+        IDI_FUNCLIST_LEAF = 622,
+
+        IDI_FUNCLIST_SORTBUTTON = 631,
+        IDI_FUNCLIST_RELOADBUTTON = 632,
+
+        IDC_MY_CUR = 1402,
+        IDC_UP_ARROW = 1403,
+        IDC_DRAG_TAB = 1404,
+        IDC_DRAG_INTERDIT_TAB = 1405,
+        IDC_DRAG_PLUS_TAB = 1406,
+        IDC_DRAG_OUT_TAB = 1407,
+
+        IDC_MACRO_RECORDING = 1408,
+
+        IDR_SAVEALL = 1500,
+        IDR_CLOSEFILE = 1501,
+        IDR_CLOSEALL = 1502,
+        IDR_FIND = 1503,
+        IDR_REPLACE = 1504,
+        IDR_ZOOMIN = 1505,
+        IDR_ZOOMOUT = 1506,
+        IDR_WRAP = 1507,
+        IDR_INVISIBLECHAR = 1508,
+        IDR_INDENTGUIDE = 1509,
+        IDR_SHOWPANNEL = 1510,
+        IDR_STARTRECORD = 1511,
+        IDR_STOPRECORD = 1512,
+        IDR_PLAYRECORD = 1513,
+        IDR_SAVERECORD = 1514,
+        IDR_SYNCV = 1515,
+        IDR_SYNCH = 1516,
+        IDR_FILENEW = 1517,
+        IDR_FILEOPEN = 1518,
+        IDR_FILESAVE = 1519,
+        IDR_PRINT = 1520,
+        IDR_CUT = 1521,
+        IDR_COPY = 1522,
+        IDR_PASTE = 1523,
+        IDR_UNDO = 1524,
+        IDR_REDO = 1525,
+        IDR_M_PLAYRECORD = 1526,
+        IDR_DOCMAP = 1527,
+        IDR_FUNC_LIST = 1528,
+        IDR_FILEBROWSER = 1529,
+        IDR_CLOSETAB = 1530,
+        IDR_CLOSETAB_INACT = 1531,
+        IDR_CLOSETAB_HOVER = 1532,
+        IDR_CLOSETAB_PUSH = 1533,
+
+        IDR_FUNC_LIST_ICO = 1534,
+        IDR_DOCMAP_ICO = 1535,
+        IDR_PROJECTPANEL_ICO = 1536,
+        IDR_CLIPBOARDPANEL_ICO = 1537,
+        IDR_ASCIIPANEL_ICO = 1538,
+        IDR_DOCSWITCHER_ICO = 1539,
+        IDR_FILEBROWSER_ICO = 1540,
+        ID_MACRO = 20000,
+        ID_MACRO_LIMIT = 20200,
+
+        ID_USER_CMD = 21000,
+        ID_USER_CMD_LIMIT = 21200,
+
+        ID_PLUGINS_CMD = 22000,
+        ID_PLUGINS_CMD_LIMIT = 22500,
+
+        ID_PLUGINS_CMD_DYNAMIC = 23000,
+        ID_PLUGINS_CMD_DYNAMIC_LIMIT = 24999,
+
+        MARKER_PLUGINS = 3,
+        MARKER_PLUGINS_LIMIT = 19,
+
+        ID_PLUGINS_REMOVING = 22501,
+        ID_PLUGINS_REMOVING_END = 22600,
+
+        IDCMD = 50000,
+
+        IDC_PREV_DOC = IDCMD+3,
+        IDC_NEXT_DOC = IDCMD+4,
+        IDC_EDIT_TOGGLEMACRORECORDING = IDCMD+5,
+
+        IDCMD_LIMIT = IDCMD+20,
+
+        IDSCINTILLA = 60000,
+        IDSCINTILLA_KEY_HOME = IDSCINTILLA+0,
+        IDSCINTILLA_KEY_HOME_WRAP = IDSCINTILLA+1,
+        IDSCINTILLA_KEY_END = IDSCINTILLA+2,
+        IDSCINTILLA_KEY_END_WRAP = IDSCINTILLA+3,
+        IDSCINTILLA_KEY_LINE_DUP = IDSCINTILLA+4,
+        IDSCINTILLA_KEY_LINE_CUT = IDSCINTILLA+5,
+        IDSCINTILLA_KEY_LINE_DEL = IDSCINTILLA+6,
+        IDSCINTILLA_KEY_LINE_TRANS = IDSCINTILLA+7,
+        IDSCINTILLA_KEY_LINE_COPY = IDSCINTILLA+8,
+        IDSCINTILLA_KEY_CUT = IDSCINTILLA+9,
+        IDSCINTILLA_KEY_COPY = IDSCINTILLA+10,
+        IDSCINTILLA_KEY_PASTE = IDSCINTILLA+11,
+        IDSCINTILLA_KEY_DEL = IDSCINTILLA+12,
+        IDSCINTILLA_KEY_SELECTALL = IDSCINTILLA+13,
+        IDSCINTILLA_KEY_OUTDENT = IDSCINTILLA+14,
+        IDSCINTILLA_KEY_UNDO = IDSCINTILLA+15,
+        IDSCINTILLA_KEY_REDO = IDSCINTILLA+16,
+        IDSCINTILLA_LIMIT = IDSCINTILLA+30,
+
+        IDD_FILEVIEW_DIALOG = 1000,
+
+        IDC_MINIMIZED_TRAY = 67001,
+
+        IDD_CREATE_DIRECTORY = 1100,
+        IDC_STATIC_CURRENT_FOLDER = 1101,
+        IDC_EDIT_NEW_FOLDER = 1102,
+
+        IDD_INSERT_INPUT_TEXT = 1200,
+        IDC_EDIT_INPUT_VALUE = 1201,
+        IDC_STATIC_INPUT_TITLE = 1202,
+        IDC_ICON_INPUT_ICON = 1203,
+
+        IDR_M30_MENU = 1500,
+
+        IDR_SYSTRAYPOPUP_MENU = 1501,
+
+        IDD_ABOUTBOX = 1700,
+        IDC_LICENCE_EDIT = 1701,
+        IDC_HOME_ADDR = 1702,
+        IDC_EMAIL_ADDR = 1703,
+        IDC_ONLINEHELP_ADDR = 1704,
+        IDC_AUTHOR_NAME = 1705,
+        IDC_BUILD_DATETIME = 1706,
+
+        IDD_DEBUGINFOBOX = 1750,
+        IDC_DEBUGINFO_EDIT = 1751,
+        IDC_DEBUGINFO_COPYLINK = 1752,
+
+        IDD_GOLINE = 2000,
+        ID_GOLINE_EDIT = IDD_GOLINE + 1,
+        ID_CURRLINE = IDD_GOLINE + 2,
+        ID_LASTLINE = IDD_GOLINE + 3,
+        ID_URHERE_STATIC = IDD_GOLINE + 4,
+        ID_UGO_STATIC = IDD_GOLINE + 5,
+        ID_NOMORETHAN_STATIC = IDD_GOLINE + 6,
+        IDC_RADIO_GOTOLINE = IDD_GOLINE + 7,
+        IDC_RADIO_GOTOOFFSET = IDD_GOLINE + 8,
+
+        IDD_VALUE_DLG = 2400,
+        IDC_VALUE_STATIC = 2401,
+        IDC_VALUE_EDIT = 2402,
+
+        IDD_BUTTON_DLG = 2410,
+        IDC_RESTORE_BUTTON = 2411,
+
+        IDD_SETTING_DLG = 2500,
+
+        NOTEPADPLUS_USER_INTERNAL = Constants.WM_USER + 0000,
+        NPPM_INTERNAL_USERCMDLIST_MODIFIED = NOTEPADPLUS_USER_INTERNAL + 1,
+        NPPM_INTERNAL_CMDLIST_MODIFIED = NOTEPADPLUS_USER_INTERNAL + 2,
+        NPPM_INTERNAL_MACROLIST_MODIFIED = NOTEPADPLUS_USER_INTERNAL + 3,
+        NPPM_INTERNAL_PLUGINCMDLIST_MODIFIED = NOTEPADPLUS_USER_INTERNAL + 4,
+        NPPM_INTERNAL_CLEARSCINTILLAKEY = NOTEPADPLUS_USER_INTERNAL + 5,
+        NPPM_INTERNAL_BINDSCINTILLAKEY = NOTEPADPLUS_USER_INTERNAL + 6,
+        NPPM_INTERNAL_SCINTILLAKEYMODIFIED = NOTEPADPLUS_USER_INTERNAL + 7,
+        NPPM_INTERNAL_SCINTILLAFINFERCOLLAPSE = NOTEPADPLUS_USER_INTERNAL + 8,
+        NPPM_INTERNAL_SCINTILLAFINFERUNCOLLAPSE = NOTEPADPLUS_USER_INTERNAL + 9,
+        NPPM_INTERNAL_DISABLEAUTOUPDATE = NOTEPADPLUS_USER_INTERNAL + 10,
+        NPPM_INTERNAL_SETTING_HISTORY_SIZE = NOTEPADPLUS_USER_INTERNAL + 11,
+        NPPM_INTERNAL_ISTABBARREDUCED = NOTEPADPLUS_USER_INTERNAL + 12,
+        NPPM_INTERNAL_ISFOCUSEDTAB = NOTEPADPLUS_USER_INTERNAL + 13,
+        NPPM_INTERNAL_GETMENU = NOTEPADPLUS_USER_INTERNAL + 14,
+        NPPM_INTERNAL_CLEARINDICATOR = NOTEPADPLUS_USER_INTERNAL + 15,
+        NPPM_INTERNAL_SCINTILLAFINFERCOPY = NOTEPADPLUS_USER_INTERNAL + 16,
+        NPPM_INTERNAL_SCINTILLAFINFERSELECTALL = NOTEPADPLUS_USER_INTERNAL + 17,
+        NPPM_INTERNAL_SETCARETWIDTH = NOTEPADPLUS_USER_INTERNAL + 18,
+        NPPM_INTERNAL_SETCARETBLINKRATE = NOTEPADPLUS_USER_INTERNAL + 19,
+        NPPM_INTERNAL_CLEARINDICATORTAGMATCH = NOTEPADPLUS_USER_INTERNAL + 20,
+        NPPM_INTERNAL_CLEARINDICATORTAGATTR = NOTEPADPLUS_USER_INTERNAL + 21,
+        NPPM_INTERNAL_SWITCHVIEWFROMHWND = NOTEPADPLUS_USER_INTERNAL + 22,
+        NPPM_INTERNAL_UPDATETITLEBAR = NOTEPADPLUS_USER_INTERNAL + 23,
+        NPPM_INTERNAL_CANCEL_FIND_IN_FILES = NOTEPADPLUS_USER_INTERNAL + 24,
+        NPPM_INTERNAL_RELOADNATIVELANG = NOTEPADPLUS_USER_INTERNAL + 25,
+        NPPM_INTERNAL_PLUGINSHORTCUTMOTIFIED = NOTEPADPLUS_USER_INTERNAL + 26,
+        NPPM_INTERNAL_SCINTILLAFINFERCLEARALL = NOTEPADPLUS_USER_INTERNAL + 27,
+        NPPM_INTERNAL_SETTING_EDGE_SIZE = NOTEPADPLUS_USER_INTERNAL + 28,
+        NPPM_INTERNAL_SETTING_TAB_REPLCESPACE = NOTEPADPLUS_USER_INTERNAL + 29,
+        NPPM_INTERNAL_SETTING_TAB_SIZE = NOTEPADPLUS_USER_INTERNAL + 30,
+        NPPM_INTERNAL_RELOADSTYLERS = NOTEPADPLUS_USER_INTERNAL + 31,
+        NPPM_INTERNAL_DOCORDERCHANGED = NOTEPADPLUS_USER_INTERNAL + 32,
+        NPPM_INTERNAL_SETMULTISELCTION = NOTEPADPLUS_USER_INTERNAL + 33,
+        NPPM_INTERNAL_SCINTILLAFINFEROPENALL = NOTEPADPLUS_USER_INTERNAL + 34,
+        NPPM_INTERNAL_RECENTFILELIST_UPDATE = NOTEPADPLUS_USER_INTERNAL + 35,
+        NPPM_INTERNAL_RECENTFILELIST_SWITCH = NOTEPADPLUS_USER_INTERNAL + 36,
+        NPPM_INTERNAL_GETSCINTEDTVIEW = NOTEPADPLUS_USER_INTERNAL + 37,
+        NPPM_INTERNAL_ENABLESNAPSHOT = NOTEPADPLUS_USER_INTERNAL + 38,
+        NPPM_INTERNAL_SAVECURRENTSESSION = NOTEPADPLUS_USER_INTERNAL + 39,
+        NPPM_INTERNAL_FINDINFINDERDLG = NOTEPADPLUS_USER_INTERNAL + 40,
+        NPPM_INTERNAL_REMOVEFINDER = NOTEPADPLUS_USER_INTERNAL + 41,
+
+        NPPM_INTERNAL_CHECKDOCSTATUS = Constants.NPPMSG + 53,
+
+        NPPM_INTERNAL_ENABLECHECKDOCOPT = Constants.NPPMSG + 54,
+
+        CHECKDOCOPT_NONE = 0,
+        CHECKDOCOPT_UPDATESILENTLY = 1,
+        CHECKDOCOPT_UPDATEGO2END = 2,
+
+        NPPM_INTERNAL_GETCHECKDOCOPT = Constants.NPPMSG + 55,
+
+        NPPM_INTERNAL_SETCHECKDOCOPT = Constants.NPPMSG + 56,
+
+        NPPM_INTERNAL_SETFILENAME = Constants.NPPMSG + 63,
+
+        SCINTILLA_USER = Constants.WM_USER + 2000,
+
+        MACRO_USER = Constants.WM_USER + 4000,
+        WM_GETCURRENTMACROSTATUS = MACRO_USER + 01,
+        WM_MACRODLGRUNMACRO = MACRO_USER + 02,
+
+        SPLITTER_USER = Constants.WM_USER + 4000,
+        WORDSTYLE_USER = Constants.WM_USER + 5000,
+        COLOURPOPUP_USER = Constants.WM_USER + 6000,
+        BABYGRID_USER = Constants.WM_USER + 7000,
+
+        MENUINDEX_FILE = 0,
+        MENUINDEX_EDIT = 1,
+        MENUINDEX_SEARCH = 2,
+        MENUINDEX_VIEW = 3,
+        MENUINDEX_FORMAT = 4,
+        MENUINDEX_LANGUAGE = 5,
+        MENUINDEX_SETTINGS = 6,
+        MENUINDEX_MACRO = 7,
+        MENUINDEX_RUN = 8,
+        MENUINDEX_PLUGINS = 9,
+		/* --Autogenerated -- end of section automatically generated from resource.h */
+	}
+}

File diff suppressed because it is too large
+ 5217 - 0
NppChnConvPlugin/NppPluginInfrastructure/ScintillaGateway.cs


File diff suppressed because it is too large
+ 3047 - 0
NppChnConvPlugin/NppPluginInfrastructure/Scintilla_iface.cs


+ 317 - 0
NppChnConvPlugin/NppPluginInfrastructure/Win32.cs

@@ -0,0 +1,317 @@
+// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
+
+using System;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace NppChnConvPlugin.NppPluginInfrastructure
+{
+	public class Win32
+	{
+		/// <summary>
+		/// Get the scroll information of a scroll bar or window with scroll bar
+		/// @see https://msdn.microsoft.com/en-us/library/windows/desktop/bb787537(v=vs.85).aspx
+		/// </summary>
+		[StructLayout(LayoutKind.Sequential)]
+		public struct ScrollInfo
+		{
+			/// <summary>
+			/// Specifies the size, in bytes, of this structure. The caller must set this to sizeof(SCROLLINFO).
+			/// </summary>
+			public uint cbSize;
+			/// <summary>
+			/// Specifies the scroll bar parameters to set or retrieve.
+			/// @see ScrollInfoMask
+			/// </summary>
+			public uint fMask;
+			/// <summary>
+			/// Specifies the minimum scrolling position.
+			/// </summary>
+			public int nMin;
+			/// <summary>
+			/// Specifies the maximum scrolling position.
+			/// </summary>
+			public int nMax;
+			/// <summary>
+			/// Specifies the page size, in device units. A scroll bar uses this value to determine the appropriate size of the proportional scroll box.
+			/// </summary>
+			public uint nPage;
+			/// <summary>
+			/// Specifies the position of the scroll box.
+			/// </summary>
+			public int nPos;
+			/// <summary>
+			/// Specifies the immediate position of a scroll box that the user is dragging. 
+			/// An application can retrieve this value while processing the SB_THUMBTRACK request code. 
+			/// An application cannot set the immediate scroll position; the SetScrollInfo function ignores this member.
+			/// </summary>
+			public int nTrackPos;
+		}
+
+		/// <summary>
+		/// Used for the ScrollInfo fMask
+		/// SIF_ALL             => Combination of SIF_PAGE, SIF_POS, SIF_RANGE, and SIF_TRACKPOS.
+		/// SIF_DISABLENOSCROLL => This value is used only when setting a scroll bar's parameters. If the scroll bar's new parameters make the scroll bar unnecessary, disable the scroll bar instead of removing it.
+		/// SIF_PAGE            => The nPage member contains the page size for a proportional scroll bar.
+		/// SIF_POS             => The nPos member contains the scroll box position, which is not updated while the user drags the scroll box.
+		/// SIF_RANGE           => The nMin and nMax members contain the minimum and maximum values for the scrolling range.
+		/// SIF_TRACKPOS        => The nTrackPos member contains the current position of the scroll box while the user is dragging it.
+		/// </summary>
+		public enum ScrollInfoMask
+		{
+			SIF_RANGE = 0x1,
+			SIF_PAGE = 0x2,
+			SIF_POS = 0x4,
+			SIF_DISABLENOSCROLL = 0x8,
+			SIF_TRACKPOS = 0x10,
+			SIF_ALL = SIF_RANGE + SIF_PAGE + SIF_POS + SIF_TRACKPOS
+		}
+
+		/// <summary>
+		/// Used for the GetScrollInfo() nBar parameter
+		/// </summary>
+		public enum ScrollInfoBar
+		{
+			SB_HORZ = 0,
+			SB_VERT = 1,
+			SB_CTL = 2,
+			SB_BOTH = 3
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		[DllImport("user32")]
+		public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		[DllImport("user32")]
+		public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		[DllImport("user32")]
+		public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		[DllImport("user32")]
+		public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, out IntPtr lParam);
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, NppMenuCmd lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), new IntPtr((uint)lParam));
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, IntPtr lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), new IntPtr(lParam));
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, out int lParam)
+		{
+			IntPtr outVal;
+			IntPtr retval = SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), out outVal);
+			lParam = outVal.ToInt32();
+			return retval;
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, int lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, wParam, new IntPtr(lParam));
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, int lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, wParam, new IntPtr(lParam));
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, IntPtr lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, string lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, int lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), new IntPtr(lParam));
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as 
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.  
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project 
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+		public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, IntPtr lParam)
+		{
+			return SendMessage(hWnd, (UInt32)Msg, wParam, lParam);
+		}
+
+		/// <summary>
+		/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
+		/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
+		/// If gateways are missing or incomplete, please help extend them and send your code to the project
+		/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
+		/// </summary>
+	public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, ref LangType lParam)
+		{
+			IntPtr outVal;
+			IntPtr retval = SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), out outVal);
+			lParam = (LangType)outVal;
+			return retval;
+		}
+
+		public const int MAX_PATH = 260;
+
+		[DllImport("kernel32")]
+		public static extern int GetPrivateProfileInt(string lpAppName, string lpKeyName, int nDefault, string lpFileName);
+
+		[DllImport("kernel32")]
+		public static extern uint GetPrivateProfileString(string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, uint nSize, string lpFileName);
+
+		[DllImport("kernel32")]
+		public static extern bool WritePrivateProfileString(string lpAppName, string lpKeyName, string lpString, string lpFileName);
+
+		public const int MF_BYCOMMAND = 0;
+		public const int MF_CHECKED = 8;
+		public const int MF_UNCHECKED = 0;
+
+		[DllImport("user32")]
+		public static extern IntPtr GetMenu(IntPtr hWnd);
+
+		[DllImport("user32")]
+		public static extern int CheckMenuItem(IntPtr hmenu, int uIDCheckItem, int uCheck);
+
+		public const int WM_CREATE = 1;
+
+		[DllImport("user32")]
+		public static extern bool ClientToScreen(IntPtr hWnd, ref Point lpPoint);
+
+		[DllImport("kernel32")]
+		public static extern void OutputDebugString(string lpOutputString);
+
+		/// <summary>
+		/// @see https://msdn.microsoft.com/en-us/library/windows/desktop/bb787583(v=vs.85).aspx
+		/// </summary>
+		/// <param name="hwnd"></param>
+		/// <param name="nBar"></param>
+		/// <param name="scrollInfo"></param>
+		/// <returns></returns>
+		[DllImport("user32")]
+		public static extern int GetScrollInfo(IntPtr hwnd, int nBar, ref ScrollInfo scrollInfo);
+	}
+}

+ 88 - 0
NppChnConvPlugin/PluginBridge.cs

@@ -0,0 +1,88 @@
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter;
+using NppChnConvPlugin.NppPluginInfrastructure;
+
+namespace NppChnConvPlugin
+{
+    internal static class PluginBridge
+    {
+        private static readonly IScintillaGateway CurrentEditor = new ScintillaGateway(PluginBase.GetCurrentScintilla());
+
+        // for get current editing file info
+        private static readonly INotepadPPGateway Notepad = new NotepadPPGateway();
+
+        public static bool Enable { get; private set; }
+
+        public static void SetupPluginMenu()
+        {
+            PluginBase.SetCommand(0, "Convert To CHS", ConvertToChs);
+            PluginBase.SetCommand(1, "Convert To CHT", ConvertToCht);
+        }
+
+        public static void SetupToolBarIcon()
+        {
+            var toolbarIcons = new toolbarIcons { hToolbarBmp = Properties.Resources.Bitmap1.GetHbitmap() };
+            var pTbIcons = Marshal.AllocHGlobal(Marshal.SizeOf(toolbarIcons));
+            Marshal.StructureToPtr(toolbarIcons, pTbIcons, false);
+            Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_ADDTOOLBARICON, PluginBase._funcItems.Items[0]._cmdID, pTbIcons);
+            Marshal.FreeHGlobal(pTbIcons);
+
+            toolbarIcons = new toolbarIcons { hToolbarBmp = Properties.Resources.Bitmap2.GetHbitmap() };
+            pTbIcons = Marshal.AllocHGlobal(Marshal.SizeOf(toolbarIcons));
+            Marshal.StructureToPtr(toolbarIcons, pTbIcons, false);
+            Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_ADDTOOLBARICON, PluginBase._funcItems.Items[1]._cmdID, pTbIcons);
+            Marshal.FreeHGlobal(pTbIcons);
+        }
+
+        private static void ConvertToChs() => DoConvertSelect(ChineseConversionDirection.TraditionalToSimplified);
+        private static void ConvertToCht() => DoConvertSelect(ChineseConversionDirection.SimplifiedToTraditional);
+
+        private static void DoConvertSelect(ChineseConversionDirection chineseConversionDirection)
+        {
+            CurrentEditor.BeginUndoAction();
+
+            var selections = CurrentEditor.GetSelections();
+
+            for (int i = selections - 1; i >= 0; i--)
+            {
+                var start = CurrentEditor.GetSelectionNStart(i);
+                var end = CurrentEditor.GetSelectionNEnd(i);
+
+                CurrentEditor.SetTargetStart(start);
+                CurrentEditor.SetTargetEnd(end);
+
+                var text = CurrentEditor.GetTargetText();
+                var convert = ChineseConverter.Convert(text, chineseConversionDirection);
+
+                var len = CurrentEditor.EncodedFromUTF8Len(convert);
+                CurrentEditor.ReplaceTarget(len, convert);
+            }
+
+            CurrentEditor.EndUndoAction();
+        }
+
+
+
+        public static void FlushState()
+        {
+            CurrentEditor.SetScintillaHandle(PluginBase.GetCurrentScintilla());
+        }
+
+        public static void UpdateText()
+        {
+        }
+
+        public static void UpdateScroll()
+        {
+
+        }
+
+        public static void Exit()
+        {
+
+        }
+    }
+}

+ 36 - 0
NppChnConvPlugin/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("NppChnConvPlugin")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("NppChnConvPlugin")]
+[assembly: AssemblyCopyright("Copyright ©  2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("4a0d912b-8bc8-4f80-9a5c-682b4e0b9e91")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 83 - 0
NppChnConvPlugin/Properties/Resources.Designer.cs

@@ -0,0 +1,83 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace NppChnConvPlugin.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NppChnConvPlugin.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap Bitmap1 {
+            get {
+                object obj = ResourceManager.GetObject("Bitmap1", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap Bitmap2 {
+            get {
+                object obj = ResourceManager.GetObject("Bitmap2", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+    }
+}

+ 127 - 0
NppChnConvPlugin/Properties/Resources.resx

@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="Bitmap1" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\Bitmap1.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="Bitmap2" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\Bitmap2.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+</root>

BIN
NppChnConvPlugin/Resources/Bitmap1.bmp


BIN
NppChnConvPlugin/Resources/Bitmap2.bmp


+ 55 - 0
NppChnConvPlugin/UnmanagedExportsStubsToBridge.cs

@@ -0,0 +1,55 @@
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Runtime.InteropServices;
+using NppChnConvPlugin.NppPluginInfrastructure;
+
+// ReSharper disable UnusedMember.Global
+// ReSharper disable InconsistentNaming
+
+namespace NppChnConvPlugin
+{
+    [SuppressMessage("ReSharper", "UnusedMember.Local")]
+    internal class UnmanagedExportsStubs
+    {
+        static UnmanagedExportsStubs()
+        {
+            AssemblyResolveInMyAround.Register();
+        }
+
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
+        private static bool isUnicode()
+        {
+            return ManagedExportsBridge.IsUnicode();
+        }
+
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
+        private static IntPtr getName()
+        {
+            return ManagedExportsBridge.GetName();
+        }
+
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
+        private static void setInfo(NppData notepadPlusData)
+        {
+            ManagedExportsBridge.SetInfo(notepadPlusData);
+        }
+
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
+        private static IntPtr getFuncsArray(ref int nbF)
+        {
+            return ManagedExportsBridge.GetFuncsArray(ref nbF);
+        }
+
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
+        private static uint messageProc(uint Message, IntPtr wParam, IntPtr lParam)
+        {
+            return ManagedExportsBridge.MessageProc(Message, wParam, lParam);
+        }
+
+        [DllExport(CallingConvention = CallingConvention.Cdecl)]
+        private static void beNotified(IntPtr notifyCode)
+        {
+            ManagedExportsBridge.BeNotified(notifyCode);
+        }
+    }
+}