タイトル : 単純なサンプル 投稿日 : 2008/07/10(Thu) 15:45 投稿者 : 花ちゃん
動作確認だけの単純なサンプル Public Class Form1 <System.Runtime.InteropServices.DllImport("USER32.DLL", _ CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _ Private Shared Function SendMessage( _ ByVal hWnd As IntPtr, _ ByVal wMsg As Integer, _ ByVal wParam As Integer, _ ByVal lParam As String) As Integer End Function Private Const WM_GETTEXT As Integer = &HD Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim bs As Integer = TextBox1.TextLength + 1 Dim buf As String = New String(CChar(" "), bs) bs = SendMessage(TextBox1.Handle, WM_GETTEXT, bs, buf) MessageBox.Show(buf) End Sub End Class |