Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 78712f5

Browse files
committed
Moved Win32 to integration
1 parent 828b8f2 commit 78712f5

File tree

9 files changed

+80
-70
lines changed

9 files changed

+80
-70
lines changed

Demo Plugin/NppManagedPluginDemo/Demo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Runtime.InteropServices;
99
using System.Text.RegularExpressions;
1010
using Kbg.NppPluginNET;
11+
using NppPluginNET.Integration;
1112

1213
namespace Kbg.NppPluginNET
1314
{

Demo Plugin/NppManagedPluginDemo/Forms/frmGoToLine.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Windows.Forms;
33
using Kbg.NppPluginNET;
4+
using NppPluginNET.Integration;
45

56
namespace Kbg.Demo.Namespace
67
{

Demo Plugin/NppManagedPluginDemo/NppManagedPluginDemo.VS2015.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
<Compile Include="..\..\Visual Studio Project Template C#\Integration\ClikeStringArray.cs">
5353
<Link>Integration\ClikeStringArray.cs</Link>
5454
</Compile>
55+
<Compile Include="..\..\Visual Studio Project Template C#\Integration\Win32.cs">
56+
<Link>Integration\Win32.cs</Link>
57+
</Compile>
5558
<Compile Include="..\..\Visual Studio Project Template C#\ScintillaGateway.cs">
5659
<Link>ScintillaGateway.cs</Link>
5760
</Compile>

Visual Studio Project Template C#/$projectname$.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<Compile Include="Forms\frmMyDlg.Designer.cs">
5151
<DependentUpon>frmMyDlg.cs</DependentUpon>
5252
</Compile>
53+
<Compile Include="Integration\Win32.cs" />
5354
<Compile Include="Main.cs" />
5455
<Compile Include="GatewayDomain.cs" />
5556
<Compile Include="ScintillaGateway.cs" />
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
using System;
2+
using System.Drawing;
3+
using System.Runtime.InteropServices;
4+
using System.Text;
5+
using Kbg.NppPluginNET.Integration;
6+
7+
namespace NppPluginNET.Integration
8+
{
9+
public class Win32
10+
{
11+
[DllImport("user32")]
12+
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, NppMenuCmd lParam);
13+
[DllImport("user32")]
14+
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, IntPtr lParam);
15+
[DllImport("user32")]
16+
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, int lParam);
17+
[DllImport("user32")]
18+
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, out int lParam);
19+
[DllImport("user32")]
20+
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, IntPtr wParam, int lParam);
21+
[DllImport("user32")]
22+
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, ref LangType lParam);
23+
[DllImport("user32")]
24+
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);
25+
[DllImport("user32")]
26+
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
27+
[DllImport("user32")]
28+
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
29+
[DllImport("user32")]
30+
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);
31+
32+
33+
// TODO KBG Experimental
34+
[DllImport("user32")]
35+
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, IntPtr lParam);
36+
[DllImport("user32")]
37+
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, int lParam);
38+
39+
40+
[DllImport("user32")]
41+
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, IntPtr lParam);
42+
[DllImport("user32")]
43+
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, string lParam);
44+
[DllImport("user32")]
45+
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lParam);
46+
[DllImport("user32")]
47+
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, int lParam);
48+
49+
public const int MAX_PATH = 260;
50+
[DllImport("kernel32")]
51+
public static extern int GetPrivateProfileInt(string lpAppName, string lpKeyName, int nDefault, string lpFileName);
52+
[DllImport("kernel32")]
53+
public static extern bool WritePrivateProfileString(string lpAppName, string lpKeyName, string lpString, string lpFileName);
54+
55+
public const int MF_BYCOMMAND = 0;
56+
public const int MF_CHECKED = 8;
57+
public const int MF_UNCHECKED = 0;
58+
[DllImport("user32")]
59+
public static extern IntPtr GetMenu(IntPtr hWnd);
60+
[DllImport("user32")]
61+
public static extern int CheckMenuItem(IntPtr hmenu, int uIDCheckItem, int uCheck);
62+
63+
public const int WM_CREATE = 1;
64+
65+
[DllImport("user32")]
66+
public static extern bool ClientToScreen(IntPtr hWnd, ref Point lpPoint);
67+
68+
[DllImport("kernel32")]
69+
public static extern void OutputDebugString(string lpOutputString);
70+
}
71+
}

Visual Studio Project Template C#/NppPlugin.vstemplate

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<ProjectItem ReplaceParameters="false" TargetFileName="Msgs_h.cs">Msgs_h.cs</ProjectItem>
4444
<ProjectItem ReplaceParameters="false" TargetFileName="Scintilla_iface.cs">Scintilla_iface.cs</ProjectItem>
4545
<ProjectItem ReplaceParameters="false" TargetFileName="ClikeStringArray.cs">ClikeStringArray.cs</ProjectItem>
46+
<ProjectItem ReplaceParameters="false" TargetFileName="Win32.cs">Win32.cs</ProjectItem>
4647
</Folder>
4748
<ProjectItem ReplaceParameters="true" TargetFileName="Main.cs" OpenInEditor="true">Main.cs</ProjectItem>
4849
<ProjectItem ReplaceParameters="false" TargetFileName="NppPluginNETBase.cs">NppPluginNETBase.cs</ProjectItem>

Visual Studio Project Template C#/NppPluginNETBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using Kbg.NppPluginNET.Integration;
3+
using NppPluginNET.Integration;
34

45
namespace Kbg.NppPluginNET
56
{

Visual Studio Project Template C#/NppPluginNETHelper.cs

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
using System.Text;
33
using System.Windows.Forms;
44
using System.Collections.Generic;
5-
using System.Drawing;
65
using System.Runtime.InteropServices;
7-
using Kbg.NppPluginNET.Integration;
86

97
namespace Kbg.NppPluginNET
108
{
11-
#region " Notepad++ "
129
[StructLayout(LayoutKind.Sequential)]
1310
public struct NppData
1411
{
@@ -190,71 +187,4 @@ public struct toolbarIcons
190187
public IntPtr hToolbarBmp;
191188
public IntPtr hToolbarIcon;
192189
}
193-
#endregion
194-
195-
#region " Platform "
196-
public class Win32
197-
{
198-
[DllImport("user32")]
199-
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, NppMenuCmd lParam);
200-
[DllImport("user32")]
201-
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, IntPtr lParam);
202-
[DllImport("user32")]
203-
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, int lParam);
204-
[DllImport("user32")]
205-
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, out int lParam);
206-
[DllImport("user32")]
207-
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, IntPtr wParam, int lParam);
208-
[DllImport("user32")]
209-
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, ref LangType lParam);
210-
[DllImport("user32")]
211-
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);
212-
[DllImport("user32")]
213-
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
214-
[DllImport("user32")]
215-
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
216-
[DllImport("user32")]
217-
public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);
218-
219-
220-
// TODO KBG Experimental
221-
[DllImport("user32")]
222-
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, IntPtr lParam);
223-
[DllImport("user32")]
224-
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, int lParam);
225-
226-
227-
[DllImport("user32")]
228-
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, IntPtr lParam);
229-
[DllImport("user32")]
230-
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, string lParam);
231-
[DllImport("user32")]
232-
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lParam);
233-
[DllImport("user32")]
234-
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, int lParam);
235-
236-
public const int MAX_PATH = 260;
237-
[DllImport("kernel32")]
238-
public static extern int GetPrivateProfileInt(string lpAppName, string lpKeyName, int nDefault, string lpFileName);
239-
[DllImport("kernel32")]
240-
public static extern bool WritePrivateProfileString(string lpAppName, string lpKeyName, string lpString, string lpFileName);
241-
242-
public const int MF_BYCOMMAND = 0;
243-
public const int MF_CHECKED = 8;
244-
public const int MF_UNCHECKED = 0;
245-
[DllImport("user32")]
246-
public static extern IntPtr GetMenu(IntPtr hWnd);
247-
[DllImport("user32")]
248-
public static extern int CheckMenuItem(IntPtr hmenu, int uIDCheckItem, int uCheck);
249-
250-
public const int WM_CREATE = 1;
251-
252-
[DllImport("user32")]
253-
public static extern bool ClientToScreen(IntPtr hWnd, ref Point lpPoint);
254-
255-
[DllImport("kernel32")]
256-
public static extern void OutputDebugString(string lpOutputString);
257-
}
258-
259-
#endregion
260190
}

Visual Studio Project Template C#/ScintillaGateway.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Text;
33
using Kbg.NppPluginNET.Integration;
4+
using NppPluginNET.Integration;
45

56
namespace Kbg.NppPluginNET
67
{

0 commit comments

Comments
 (0)