24-12-13, 02:03 AM
PHP كود :
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWndParent As Integer, ByVal hWndChildAfter As Integer, ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer
Public Const WM_SETTEXT = &HC
Public Sub SetNotepadText()
Static StringToSend As String = ""
Dim notepadHwnd = FindWindow(Nothing, "Untitled - Notepad")
Dim editHwnd = FindWindowEx(notepadHwnd, 0, "Edit", Nothing)
StringToSend &= "Hello World! "
SendMessageByString(editHwnd, WM_SETTEXT, 0, StringToSend)
End Sub
جرب هذا الكود !
