Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Fixing the project to be usable under Notepad++ x64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaillon committed Nov 26, 2016
1 parent 54169e0 commit 63d0f40
Show file tree
Hide file tree
Showing 13 changed files with 207 additions and 137 deletions.
68 changes: 35 additions & 33 deletions 3P.sln
Expand Up @@ -11,48 +11,50 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectListView2012", "Objec
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64
Debug|x86 = Debug|x86 Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU Release|x64 = Release|x64
Release|x86 = Release|x86 Release|x86 = Release|x86
Signed|Any CPU = Signed|Any CPU Signed|x64 = Signed|x64
Signed|x86 = Signed|x86 Signed|x86 = Signed|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Debug|x64.ActiveCfg = Debug|x64
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Debug|Any CPU.Build.0 = Debug|Any CPU {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Debug|x64.Build.0 = Debug|x64
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Debug|x86.ActiveCfg = Debug|Any CPU {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Debug|x86.ActiveCfg = Debug|x86
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Debug|x86.Build.0 = Debug|Any CPU {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Debug|x86.Build.0 = Debug|x86
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Release|Any CPU.ActiveCfg = Release|Any CPU {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Release|x64.ActiveCfg = Release|x64
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Release|Any CPU.Build.0 = Release|Any CPU {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Release|x64.Build.0 = Release|x64
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Release|x86.ActiveCfg = Release|x86 {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Release|x86.ActiveCfg = Release|x86
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Release|x86.Build.0 = Release|x86 {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Release|x86.Build.0 = Release|x86
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Signed|Any CPU.ActiveCfg = Release|Any CPU {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Signed|x64.ActiveCfg = Release|x64
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Signed|Any CPU.Build.0 = Release|Any CPU {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Signed|x64.Build.0 = Release|x64
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Signed|x86.ActiveCfg = Release|x86 {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Signed|x86.ActiveCfg = Release|x86
{9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Signed|x86.Build.0 = Release|x86 {9A5EC9F0-4DB3-44D6-AA1F-27E031666936}.Signed|x86.Build.0 = Release|x86
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Debug|x64.ActiveCfg = Debug|x64
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Debug|Any CPU.Build.0 = Debug|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Debug|x64.Build.0 = Debug|x64
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Debug|x86.ActiveCfg = Debug|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Debug|x86.ActiveCfg = Debug|x86
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Debug|x86.Build.0 = Debug|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Debug|x86.Build.0 = Debug|x86
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Release|Any CPU.ActiveCfg = Release|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Release|x64.ActiveCfg = Release|x64
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Release|Any CPU.Build.0 = Release|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Release|x64.Build.0 = Release|x64
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Release|x86.ActiveCfg = Release|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Release|x86.ActiveCfg = Release|x86
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Release|x86.Build.0 = Release|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Release|x86.Build.0 = Release|x86
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Signed|Any CPU.ActiveCfg = Release|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Signed|x64.ActiveCfg = Release|x64
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Signed|Any CPU.Build.0 = Release|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Signed|x64.Build.0 = Release|x64
{0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Signed|x86.ActiveCfg = Release|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Signed|x86.ActiveCfg = Release|x86
{18FEDA0C-D147-4286-B39A-01204808106A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0A4BE330-B2BB-43A5-B392-15DCE4736E55}.Signed|x86.Build.0 = Release|x86
{18FEDA0C-D147-4286-B39A-01204808106A}.Debug|Any CPU.Build.0 = Debug|Any CPU {18FEDA0C-D147-4286-B39A-01204808106A}.Debug|x64.ActiveCfg = Debug|x64
{18FEDA0C-D147-4286-B39A-01204808106A}.Debug|x86.ActiveCfg = Debug|Any CPU {18FEDA0C-D147-4286-B39A-01204808106A}.Debug|x64.Build.0 = Debug|x64
{18FEDA0C-D147-4286-B39A-01204808106A}.Debug|x86.Build.0 = Debug|Any CPU {18FEDA0C-D147-4286-B39A-01204808106A}.Debug|x86.ActiveCfg = Debug|x86
{18FEDA0C-D147-4286-B39A-01204808106A}.Release|Any CPU.ActiveCfg = Release|Any CPU {18FEDA0C-D147-4286-B39A-01204808106A}.Debug|x86.Build.0 = Debug|x86
{18FEDA0C-D147-4286-B39A-01204808106A}.Release|Any CPU.Build.0 = Release|Any CPU {18FEDA0C-D147-4286-B39A-01204808106A}.Release|x64.ActiveCfg = Release|x64
{18FEDA0C-D147-4286-B39A-01204808106A}.Release|x86.ActiveCfg = Release|Any CPU {18FEDA0C-D147-4286-B39A-01204808106A}.Release|x64.Build.0 = Release|x64
{18FEDA0C-D147-4286-B39A-01204808106A}.Release|x86.Build.0 = Release|Any CPU {18FEDA0C-D147-4286-B39A-01204808106A}.Release|x86.ActiveCfg = Release|x86
{18FEDA0C-D147-4286-B39A-01204808106A}.Signed|Any CPU.ActiveCfg = Release|Any CPU {18FEDA0C-D147-4286-B39A-01204808106A}.Release|x86.Build.0 = Release|x86
{18FEDA0C-D147-4286-B39A-01204808106A}.Signed|Any CPU.Build.0 = Release|Any CPU {18FEDA0C-D147-4286-B39A-01204808106A}.Signed|x64.ActiveCfg = Release|x64
{18FEDA0C-D147-4286-B39A-01204808106A}.Signed|x86.ActiveCfg = Release|Any CPU {18FEDA0C-D147-4286-B39A-01204808106A}.Signed|x64.Build.0 = Release|x64
{18FEDA0C-D147-4286-B39A-01204808106A}.Signed|x86.ActiveCfg = Release|x86
{18FEDA0C-D147-4286-B39A-01204808106A}.Signed|x86.Build.0 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
Expand Down
47 changes: 25 additions & 22 deletions 3PA/3P.csproj
Expand Up @@ -32,48 +32,49 @@
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup>
<ApplicationIcon>
</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseVSHostingProcess>false</UseVSHostingProcess> <UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<PlatformTarget>AnyCPU</PlatformTarget> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>
</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\..\LiberKey\Apps\Notepad++\App\Notepad++\plugins\</OutputPath> <OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess> <UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x86\Release\</OutputPath> <OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
Expand Down Expand Up @@ -677,8 +678,10 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>if exist "$(SolutionDir)..\3P_notepad++\plugins\" copy /Y "$(TargetPath)" "$(SolutionDir)..\3P_notepad++\plugins\$(TargetFileName)" <PostBuildEvent>if exist "$(SolutionDir)..\3P_notepad++\plugins\" ( if exist "$(ProjectDir)bin\x86\Debug\$(TargetName)$(TargetExt)" (copy /Y "$(ProjectDir)bin\x86\Debug\$(TargetName)$(TargetExt)" "$(SolutionDir)..\3P_notepad++\plugins\$(TargetName)$(TargetExt)"))
if exist "$(SolutionDir)..\3P_notepad++\plugins\" copy /Y "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)..\3P_notepad++\plugins\$(TargetName).pdb"</PostBuildEvent> if exist "$(SolutionDir)..\3P_notepad++\plugins\" ( if exist "$(ProjectDir)bin\x86\Debug\$(TargetName).pdb" (copy /Y "$(ProjectDir)bin\x86\Debug\$(TargetName).pdb" "$(SolutionDir)..\3P_notepad++\plugins\$(TargetName).pdb"))
if exist "$(SolutionDir)..\3P_notepad++x64\plugins\" ( if exist "$(ProjectDir)bin\x64\Debug\$(TargetName)$(TargetExt)" (copy /Y "$(ProjectDir)bin\x64\Debug\$(TargetName)$(TargetExt)" "$(SolutionDir)..\3P_notepad++x64\plugins\$(TargetName)$(TargetExt)"))
if exist "$(SolutionDir)..\3P_notepad++x64\plugins\" ( if exist "$(ProjectDir)bin\x64\Debug\$(TargetName).pdb" (copy /Y "$(ProjectDir)bin\x64\Debug\$(TargetName).pdb" "$(SolutionDir)..\3P_notepad++x64\plugins\$(TargetName).pdb"))</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<Import Project="../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets" Condition="Exists('../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets')" /> <Import Project="../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets" Condition="Exists('../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
24 changes: 12 additions & 12 deletions 3PA/Interop/NotepadHelper.cs
Expand Up @@ -65,17 +65,17 @@ internal class FuncItems : IDisposable {
RtlMoveMemory(newPointer, _nativePointer, oldSize); RtlMoveMemory(newPointer, _nativePointer, oldSize);
Marshal.FreeHGlobal(_nativePointer); Marshal.FreeHGlobal(_nativePointer);
} }
IntPtr ptrPosNewItem = (IntPtr)((int)newPointer + oldSize); IntPtr ptrPosNewItem = (IntPtr)(newPointer.ToInt64() + oldSize);
byte[] aB = Encoding.Unicode.GetBytes(funcItem._itemName + "\0"); byte[] aB = Encoding.Unicode.GetBytes(funcItem._itemName + "\0");
Marshal.Copy(aB, 0, ptrPosNewItem, aB.Length); Marshal.Copy(aB, 0, ptrPosNewItem, aB.Length);
ptrPosNewItem = (IntPtr)((int)ptrPosNewItem + 128); ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 128);
IntPtr p = (funcItem._pFunc != null) ? Marshal.GetFunctionPointerForDelegate(funcItem._pFunc) : IntPtr.Zero; IntPtr p = (funcItem._pFunc != null) ? Marshal.GetFunctionPointerForDelegate(funcItem._pFunc) : IntPtr.Zero;
Marshal.WriteIntPtr(ptrPosNewItem, p); Marshal.WriteIntPtr(ptrPosNewItem, p);
ptrPosNewItem = (IntPtr)((int)ptrPosNewItem + IntPtr.Size); ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + IntPtr.Size);
Marshal.WriteInt32(ptrPosNewItem, funcItem._cmdID); Marshal.WriteInt64(ptrPosNewItem, funcItem._cmdID);
ptrPosNewItem = (IntPtr)((int)ptrPosNewItem + 4); ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 4);
Marshal.WriteInt32(ptrPosNewItem, Convert.ToInt32(funcItem._init2Check)); Marshal.WriteInt64(ptrPosNewItem, Convert.ToInt64(funcItem._init2Check));
ptrPosNewItem = (IntPtr)((int)ptrPosNewItem + 4); ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 4);
if (funcItem._pShKey._key != 0) { if (funcItem._pShKey._key != 0) {
IntPtr newShortCutKey = Marshal.AllocHGlobal(4); IntPtr newShortCutKey = Marshal.AllocHGlobal(4);
Marshal.StructureToPtr(funcItem._pShKey, newShortCutKey, false); Marshal.StructureToPtr(funcItem._pShKey, newShortCutKey, false);
Expand All @@ -88,15 +88,15 @@ internal class FuncItems : IDisposable {
for (int i = 0; i < _funcItems.Count; i++) { for (int i = 0; i < _funcItems.Count; i++) {
FuncItem updatedItem = new FuncItem(); FuncItem updatedItem = new FuncItem();
updatedItem._itemName = _funcItems[i]._itemName; updatedItem._itemName = _funcItems[i]._itemName;
ptrPosItem = (IntPtr)((int)ptrPosItem + 128); ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 128);
updatedItem._pFunc = _funcItems[i]._pFunc; updatedItem._pFunc = _funcItems[i]._pFunc;
ptrPosItem = (IntPtr)((int)ptrPosItem + IntPtr.Size); ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + IntPtr.Size);
updatedItem._cmdID = Marshal.ReadInt32(ptrPosItem); updatedItem._cmdID = Marshal.ReadInt32(ptrPosItem);
ptrPosItem = (IntPtr)((int)ptrPosItem + 4); ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 4);
updatedItem._init2Check = _funcItems[i]._init2Check; updatedItem._init2Check = _funcItems[i]._init2Check;
ptrPosItem = (IntPtr)((int)ptrPosItem + 4); ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 4);
updatedItem._pShKey = _funcItems[i]._pShKey; updatedItem._pShKey = _funcItems[i]._pShKey;
ptrPosItem = (IntPtr)((int)ptrPosItem + IntPtr.Size); ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + IntPtr.Size);
_funcItems[i] = updatedItem; _funcItems[i] = updatedItem;
} }
} }
Expand Down
6 changes: 3 additions & 3 deletions 3PA/Interop/ScintillaHelper.cs
Expand Up @@ -32,7 +32,7 @@ public struct Sci_NotifyHeader {
* hwndFrom is really an environment specific window handle or pointer * hwndFrom is really an environment specific window handle or pointer
* but most clients of Scintilla.h do not have this type visible. */ * but most clients of Scintilla.h do not have this type visible. */
public IntPtr hwndFrom; public IntPtr hwndFrom;
public uint idFrom; public IntPtr idFrom;
public uint code; public uint code;
} }


Expand All @@ -47,8 +47,8 @@ public struct SCNotification {
public int length; /* SCN_MODIFIED */ public int length; /* SCN_MODIFIED */
public int linesAdded; /* SCN_MODIFIED */ public int linesAdded; /* SCN_MODIFIED */
public int message; /* SCN_MACRORECORD */ public int message; /* SCN_MACRORECORD */
public uint wParam; /* SCN_MACRORECORD */ public IntPtr wParam; /* SCN_MACRORECORD */
public int lParam; /* SCN_MACRORECORD */ public IntPtr lParam; /* SCN_MACRORECORD */
public int line; /* SCN_MODIFIED */ public int line; /* SCN_MODIFIED */
public int foldLevelNow; /* SCN_MODIFIED */ public int foldLevelNow; /* SCN_MODIFIED */
public int foldLevelPrev; /* SCN_MODIFIED */ public int foldLevelPrev; /* SCN_MODIFIED */
Expand Down
77 changes: 54 additions & 23 deletions 3PA/Interop/WinApi.cs
Expand Up @@ -40,46 +40,77 @@ internal class WinApi {
/// Scintilla provides messages that allow you to call the Scintilla message function directly. /// Scintilla provides messages that allow you to call the Scintilla message function directly.
/// This is the delegate! /// This is the delegate!
/// </summary> /// </summary>
public delegate IntPtr Scintilla_DirectFunction(IntPtr ptr, int iMessage, IntPtr wParam, IntPtr lParam); /// <remarks>
/// The interface defined in notepad++ scintilla.h is :
/// public delegate long Scintilla_DirectFunction(long ptr, uint iMessage, ulong wParam, long lParam);
/// </remarks>
public delegate IntPtr Scintilla_DirectFunction(IntPtr ptr, uint iMessage, IntPtr wParam, IntPtr lParam);


[DllImport("user32.dll")] [DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);


[DllImport("user32.dll")] [DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, NppMenuCmd lParam); public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, out IntPtr lParam);


[DllImport("user32.dll")] [DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, IntPtr lParam); public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);


[DllImport("user32.dll")] [DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, int lParam); public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);


[DllImport("user32.dll")] public static IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam) {
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, bool lParam); return SendMessage(hWnd, (UInt32)msg, wParam, lParam);
}


[DllImport("user32.dll")] public static IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, NppMenuCmd lParam) {
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, out int lParam); return SendMessage(hWnd, (UInt32)msg, new IntPtr(wParam), new IntPtr((uint) lParam));
}

public static IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, IntPtr lParam) {
return SendMessage(hWnd, (UInt32)msg, new IntPtr(wParam), lParam);
}


[DllImport("user32.dll")] public static IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, int lParam) {
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg msg, IntPtr wParam, int lParam); return SendMessage(hWnd, (UInt32)msg, new IntPtr(wParam), new IntPtr(lParam));
}


[DllImport("user32.dll")] public static IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, bool lParam) {
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam); return SendMessage(hWnd, (UInt32)msg, new IntPtr(wParam), lParam.ToPointer());
}


[DllImport("user32.dll")] public static IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, out int lParam) {
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam); IntPtr outVal;
IntPtr retval = SendMessage(hWnd, (UInt32)msg, new IntPtr(wParam), out outVal);
lParam = outVal.ToInt32();
return retval;
}


[DllImport("user32.dll")] public static IntPtr SendMessage(IntPtr hWnd, NppMsg msg, IntPtr wParam, int lParam) {
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam); return SendMessage(hWnd, (UInt32)msg, wParam, new IntPtr(lParam));
}


[DllImport("user32.dll")] public static IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, StringBuilder lParam) {
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg msg, int wParam, string lParam); return SendMessage(hWnd, (UInt32)msg, new IntPtr(wParam), lParam);
}
public static IntPtr SendMessage(IntPtr hWnd, NppMsg msg, int wParam, string lParam) {
return SendMessage(hWnd, (UInt32)msg, new IntPtr(wParam), lParam);
}


[DllImport("user32.dll")] public static IntPtr SendMessage(IntPtr hWnd, NppMsg msg, IntPtr wParam, string lParam) {
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg msg, int wParam, int lParam); return SendMessage(hWnd, (UInt32)msg, wParam, lParam);
}


[DllImport("user32.dll")] public static IntPtr SendMessage(IntPtr hWnd, SciMsg msg, int wParam, string lParam) {
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, int wParam, IntPtr lParam); return SendMessage(hWnd, (UInt32)msg, new IntPtr(wParam), lParam);
}

public static IntPtr SendMessage(IntPtr hWnd, SciMsg msg, int wParam, int lParam) {
return SendMessage(hWnd, (UInt32)msg, new IntPtr(wParam), new IntPtr(lParam));
}

public static IntPtr SendMessage(IntPtr hWnd, uint msg, int wParam, IntPtr lParam) {
return SendMessage(hWnd, msg, new IntPtr(wParam), lParam);
}


public const int MaxPath = 260; public const int MaxPath = 260;


Expand Down

0 comments on commit 63d0f40

Please sign in to comment.