-
Sendmessage to Notepad
Should be simple enough, but i cant get it to work. First time using API.
Im trying to send text to a Notepad window. Code is below:
---
winHwnd = FindWindow(vbNullString, "notepad.txt - Notepad")
If winHwnd <> 0 Then
msgbox "found"
SendMessage winHwnd, WM_SETTEXT, 0, "hello"
end if
---
It finds the proper window, hence I get "found" in a msgbox.
But it does not send the "hello" to the Notepad.
What am i doing wrong? Sample code would be appreciated. Thanx.
-
I believe you need to (to put it in VB Terims) find the Textbox inside the Notepad form. Your writing to the Form not the editable part =)
-
alright.. but how do i go on about doing that? Sample code anyone? =)
-
altho it isnt an API call, ues AppActivate to switch to notepad once u have found the window. just a sugestion.
-
that would work if im going to use Sendkeys. But thats not what im after, i would like to send keystrokes to notepad without it being the active app. In other words i would be working on the comp on a different application while my VB prog sends keys to notepad in the background.
I looked all over the vbforums and vb-world examples but couldnt come up with something that would work.. except for one example that closes the notepad window.
still looking for help :confused: