@@ -15,7 +15,7 @@ public class Win32
15
15
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
16
16
/// </summary>
17
17
[ DllImport ( "user32" ) ]
18
- public static extern IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , NppMenuCmd lParam ) ;
18
+ public static extern IntPtr SendMessage ( IntPtr hWnd , UInt32 Msg , IntPtr wParam , [ MarshalAs ( UnmanagedType . LPWStr ) ] string lParam ) ;
19
19
20
20
/// <summary>
21
21
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
@@ -24,7 +24,7 @@ public class Win32
24
24
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
25
25
/// </summary>
26
26
[ DllImport ( "user32" ) ]
27
- public static extern IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , IntPtr lParam ) ;
27
+ public static extern IntPtr SendMessage ( IntPtr hWnd , UInt32 Msg , IntPtr wParam , [ MarshalAs ( UnmanagedType . LPWStr ) ] StringBuilder lParam ) ;
28
28
29
29
/// <summary>
30
30
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
@@ -33,7 +33,7 @@ public class Win32
33
33
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
34
34
/// </summary>
35
35
[ DllImport ( "user32" ) ]
36
- public static extern IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , int lParam ) ;
36
+ public static extern IntPtr SendMessage ( IntPtr hWnd , UInt32 Msg , IntPtr wParam , IntPtr lParam ) ;
37
37
38
38
/// <summary>
39
39
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
@@ -42,123 +42,167 @@ public class Win32
42
42
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
43
43
/// </summary>
44
44
[ DllImport ( "user32" ) ]
45
- public static extern IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , out int lParam ) ;
45
+ public static extern IntPtr SendMessage ( IntPtr hWnd , UInt32 Msg , IntPtr wParam , out IntPtr lParam ) ;
46
46
47
47
/// <summary>
48
48
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
49
49
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
50
50
/// If gateways are missing or incomplete, please help extend them and send your code to the project
51
51
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
52
52
/// </summary>
53
- [ DllImport ( "user32" ) ]
54
- public static extern IntPtr SendMessage ( IntPtr hWnd , uint Msg , IntPtr wParam , int lParam ) ;
53
+ public static IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , NppMenuCmd lParam )
54
+ {
55
+ return SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , new IntPtr ( ( uint ) lParam ) ) ;
56
+ }
57
+
55
58
/// <summary>
56
59
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
57
60
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
58
61
/// If gateways are missing or incomplete, please help extend them and send your code to the project
59
62
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
60
63
/// </summary>
64
+ public static IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , IntPtr lParam )
65
+ {
66
+ return SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , lParam ) ;
67
+ }
61
68
62
69
/// <summary>
63
70
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
64
71
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
65
72
/// If gateways are missing or incomplete, please help extend them and send your code to the project
66
73
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
67
74
/// </summary>
68
- [ DllImport ( "user32" ) ]
69
- public static extern IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , ref LangType lParam ) ;
75
+ public static IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , int lParam )
76
+ {
77
+ return SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , new IntPtr ( lParam ) ) ;
78
+ }
70
79
71
80
/// <summary>
72
81
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
73
82
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
74
83
/// If gateways are missing or incomplete, please help extend them and send your code to the project
75
84
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
76
85
/// </summary>
77
- [ DllImport ( "user32" ) ]
78
- public static extern IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , [ MarshalAs ( UnmanagedType . LPWStr ) ] StringBuilder lParam ) ;
86
+ public static IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , out int lParam )
87
+ {
88
+ IntPtr outVal ;
89
+ IntPtr retval = SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , out outVal ) ;
90
+ lParam = outVal . ToInt32 ( ) ;
91
+ return retval ;
92
+ }
79
93
80
94
/// <summary>
81
95
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
82
96
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
83
97
/// If gateways are missing or incomplete, please help extend them and send your code to the project
84
98
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
85
99
/// </summary>
86
- [ DllImport ( "user32" ) ]
87
- public static extern IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , [ MarshalAs ( UnmanagedType . LPWStr ) ] string lParam ) ;
100
+ public static IntPtr SendMessage ( IntPtr hWnd , uint Msg , IntPtr wParam , int lParam )
101
+ {
102
+ return SendMessage ( hWnd , ( UInt32 ) Msg , wParam , new IntPtr ( lParam ) ) ;
103
+ }
88
104
89
105
/// <summary>
90
106
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
91
107
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
92
108
/// If gateways are missing or incomplete, please help extend them and send your code to the project
93
109
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
94
110
/// </summary>
95
- [ DllImport ( "user32" ) ]
96
- public static extern IntPtr SendMessage ( IntPtr hWnd , uint Msg , IntPtr wParam , [ MarshalAs ( UnmanagedType . LPWStr ) ] string lParam ) ;
111
+ public static IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , [ MarshalAs ( UnmanagedType . LPWStr ) ] StringBuilder lParam )
112
+ {
113
+ return SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , lParam ) ;
114
+ }
97
115
98
116
/// <summary>
99
117
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
100
118
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
101
119
/// If gateways are missing or incomplete, please help extend them and send your code to the project
102
120
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
103
121
/// </summary>
104
- [ DllImport ( "user32" ) ]
105
- public static extern IntPtr SendMessage ( IntPtr hWnd , uint Msg , IntPtr wParam , [ MarshalAs ( UnmanagedType . LPWStr ) ] StringBuilder lParam ) ;
106
-
122
+ public static IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , [ MarshalAs ( UnmanagedType . LPWStr ) ] string lParam )
123
+ {
124
+ return SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , lParam ) ;
125
+ }
107
126
108
- // TODO KBG Experimental
109
127
/// <summary>
110
128
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
111
129
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
112
130
/// If gateways are missing or incomplete, please help extend them and send your code to the project
113
131
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
114
132
/// </summary>
115
- [ DllImport ( "user32" ) ]
116
- public static extern IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , IntPtr wParam , IntPtr lParam ) ;
133
+ public static IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , IntPtr wParam , int lParam )
134
+ {
135
+ return SendMessage ( hWnd , ( UInt32 ) Msg , wParam , new IntPtr ( lParam ) ) ;
136
+ }
137
+
117
138
/// <summary>
118
139
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
119
140
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
120
141
/// If gateways are missing or incomplete, please help extend them and send your code to the project
121
142
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
122
143
/// </summary>
123
- [ DllImport ( "user32" ) ]
124
- public static extern IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , IntPtr wParam , int lParam ) ;
125
-
144
+ public static IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , int wParam , IntPtr lParam )
145
+ {
146
+ return SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , lParam ) ;
147
+ }
126
148
127
149
/// <summary>
128
150
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
129
151
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
130
152
/// If gateways are missing or incomplete, please help extend them and send your code to the project
131
153
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
132
154
/// </summary>
133
- [ DllImport ( "user32" ) ]
134
- public static extern IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , int wParam , IntPtr lParam ) ;
155
+ public static IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , int wParam , string lParam )
156
+ {
157
+ return SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , lParam ) ;
158
+ }
135
159
136
160
/// <summary>
137
161
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
138
162
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
139
163
/// If gateways are missing or incomplete, please help extend them and send your code to the project
140
164
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
141
165
/// </summary>
142
- [ DllImport ( "user32" ) ]
143
- public static extern IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , int wParam , string lParam ) ;
166
+ public static IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , int wParam , [ MarshalAs ( UnmanagedType . LPStr ) ] StringBuilder lParam )
167
+ {
168
+ return SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , lParam ) ;
169
+ }
144
170
145
171
/// <summary>
146
172
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
147
173
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
148
174
/// If gateways are missing or incomplete, please help extend them and send your code to the project
149
175
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
150
176
/// </summary>
151
- [ DllImport ( "user32" ) ]
152
- public static extern IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , int wParam , [ MarshalAs ( UnmanagedType . LPStr ) ] StringBuilder lParam ) ;
177
+ public static IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , int wParam , int lParam )
178
+ {
179
+ return SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , new IntPtr ( lParam ) ) ;
180
+ }
153
181
154
182
/// <summary>
155
183
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
156
184
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
157
185
/// If gateways are missing or incomplete, please help extend them and send your code to the project
158
186
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
159
187
/// </summary>
160
- [ DllImport ( "user32" ) ]
161
- public static extern IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , int wParam , int lParam ) ;
188
+ public static IntPtr SendMessage ( IntPtr hWnd , SciMsg Msg , IntPtr wParam , IntPtr lParam )
189
+ {
190
+ return SendMessage ( hWnd , ( UInt32 ) Msg , wParam , lParam ) ;
191
+ }
192
+
193
+ /// <summary>
194
+ /// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
195
+ /// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
196
+ /// If gateways are missing or incomplete, please help extend them and send your code to the project
197
+ /// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
198
+ /// </summary>
199
+ public static IntPtr SendMessage ( IntPtr hWnd , uint Msg , int wParam , ref LangType lParam )
200
+ {
201
+ IntPtr outVal ;
202
+ IntPtr retval = SendMessage ( hWnd , ( UInt32 ) Msg , new IntPtr ( wParam ) , out outVal ) ;
203
+ lParam = ( LangType ) outVal ;
204
+ return retval ;
205
+ }
162
206
163
207
public const int MAX_PATH = 260 ;
164
208
@@ -186,4 +230,4 @@ public class Win32
186
230
[ DllImport ( "kernel32" ) ]
187
231
public static extern void OutputDebugString ( string lpOutputString ) ;
188
232
}
189
- }
233
+ }
0 commit comments