質問編集履歴
1
現在のソースと例外内容を追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -79,4 +79,47 @@
|
|
79
79
|
.NET Framework 4.0 Client Profile
|
80
80
|
|
81
81
|
|
82
|
-
情報が不足していたらご指摘いただけますと幸いです。
|
82
|
+
情報が不足していたらご指摘いただけますと幸いです。
|
83
|
+
|
84
|
+
###追記
|
85
|
+
|
86
|
+
以下、修正した内容です。
|
87
|
+
```VB
|
88
|
+
<System.Runtime.InteropServices.DllImport("User32.Dll")>
|
89
|
+
Private Shared Function SendMessage(
|
90
|
+
ByVal hWnd As IntPtr,
|
91
|
+
ByVal Msg As Integer,
|
92
|
+
ByVal wParam As Integer,
|
93
|
+
ByVal lParam As Integer) As Integer
|
94
|
+
End Function
|
95
|
+
|
96
|
+
<System.Runtime.InteropServices.DllImport("User32.Dll")>
|
97
|
+
Private Shared Function MakeWParam(
|
98
|
+
ByVal download As Integer,
|
99
|
+
ByVal hiWord As Integer) As Integer
|
100
|
+
End Function
|
101
|
+
|
102
|
+
Private Sub tmrTest_Tick(sender As Object, e As EventArgs) Handles tmrTest.Tick
|
103
|
+
Dim control As Control = Me.ActiveControl
|
104
|
+
|
105
|
+
Me.ActiveControl = txtTest
|
106
|
+
|
107
|
+
Const EM_LINEFROMCHAR As Integer = &HC9
|
108
|
+
Const EM_SCROLL As Integer = &HB5
|
109
|
+
Const SB_THUMBPOSITION As Integer = 4
|
110
|
+
|
111
|
+
Dim row As Integer = SendMessage(txtTest.Handle, EM_LINEFROMCHAR, -1, 0) + 1
|
112
|
+
|
113
|
+
SendMessage(txtTest.Handle, EM_SCROLL, MakeWParam(SB_THUMBPOSITION, row), 0)'ここで例外が出る
|
114
|
+
|
115
|
+
txtTest.Select()
|
116
|
+
|
117
|
+
txtTest.ScrollToCaret()
|
118
|
+
|
119
|
+
Me.ActiveControl = control
|
120
|
+
End Sub
|
121
|
+
```
|
122
|
+
以下、例外の内容です。
|
123
|
+
```VB
|
124
|
+
System.EntryPointNotFoundException: 'DLL 'User32.Dll' の 'MakeWParam' というエントリ ポイントが見つかりません。'
|
125
|
+
```
|