質問編集履歴

1

現在のソースと例外内容を追記

2019/04/08 07:41

投稿

heart_crimson
heart_crimson

スコア15

test CHANGED
File without changes
test CHANGED
@@ -161,3 +161,89 @@
161
161
 
162
162
 
163
163
  情報が不足していたらご指摘いただけますと幸いです。
164
+
165
+
166
+
167
+ ###追記
168
+
169
+
170
+
171
+ 以下、修正した内容です。
172
+
173
+ ```VB
174
+
175
+ <System.Runtime.InteropServices.DllImport("User32.Dll")>
176
+
177
+ Private Shared Function SendMessage(
178
+
179
+ ByVal hWnd As IntPtr,
180
+
181
+ ByVal Msg As Integer,
182
+
183
+ ByVal wParam As Integer,
184
+
185
+ ByVal lParam As Integer) As Integer
186
+
187
+ End Function
188
+
189
+
190
+
191
+ <System.Runtime.InteropServices.DllImport("User32.Dll")>
192
+
193
+ Private Shared Function MakeWParam(
194
+
195
+ ByVal download As Integer,
196
+
197
+ ByVal hiWord As Integer) As Integer
198
+
199
+ End Function
200
+
201
+
202
+
203
+ Private Sub tmrTest_Tick(sender As Object, e As EventArgs) Handles tmrTest.Tick
204
+
205
+ Dim control As Control = Me.ActiveControl
206
+
207
+
208
+
209
+ Me.ActiveControl = txtTest
210
+
211
+
212
+
213
+ Const EM_LINEFROMCHAR As Integer = &HC9
214
+
215
+ Const EM_SCROLL As Integer = &HB5
216
+
217
+ Const SB_THUMBPOSITION As Integer = 4
218
+
219
+
220
+
221
+ Dim row As Integer = SendMessage(txtTest.Handle, EM_LINEFROMCHAR, -1, 0) + 1
222
+
223
+
224
+
225
+ SendMessage(txtTest.Handle, EM_SCROLL, MakeWParam(SB_THUMBPOSITION, row), 0)'ここで例外が出る
226
+
227
+
228
+
229
+ txtTest.Select()
230
+
231
+
232
+
233
+ txtTest.ScrollToCaret()
234
+
235
+
236
+
237
+ Me.ActiveControl = control
238
+
239
+ End Sub
240
+
241
+ ```
242
+
243
+ 以下、例外の内容です。
244
+
245
+ ```VB
246
+
247
+ System.EntryPointNotFoundException: 'DLL 'User32.Dll' の 'MakeWParam' というエントリ ポイントが見つかりません。'
248
+
249
+ ```