?
=?iso-8859-1?Q?Seb_Sch=F6ps?=
Hello,
I try to read the content of an open Notepad window, but I don't get WM_GETTEXT to work with Visual Basic .NET. I have the correct handle for the Notepad window and get the number of signs with wm_gettextlength, but no results for wm_gettext.
Here is how I try it:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Object, ByVal lParam As Object) As Integer
Public Const WM_GETTEXT = &HD
Public Const WM_GETTEXTLENGTH = &HE
dim length, NotepadResult as String
length = SendMessage(handle2, WM_GETTEXTLENGTH, Nothing, 0)
SendMessage(handle2, WM_GETTEXT, length, NotepadResult)
Anyone knows how to get this to work?
Thanks in advance for any help!
Regards
Sebastian
I try to read the content of an open Notepad window, but I don't get WM_GETTEXT to work with Visual Basic .NET. I have the correct handle for the Notepad window and get the number of signs with wm_gettextlength, but no results for wm_gettext.
Here is how I try it:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Object, ByVal lParam As Object) As Integer
Public Const WM_GETTEXT = &HD
Public Const WM_GETTEXTLENGTH = &HE
dim length, NotepadResult as String
length = SendMessage(handle2, WM_GETTEXTLENGTH, Nothing, 0)
SendMessage(handle2, WM_GETTEXT, length, NotepadResult)
Anyone knows how to get this to work?
Thanks in advance for any help!
Regards
Sebastian