|
-
Feb 16th, 2002, 05:33 PM
#1
Thread Starter
New Member
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.
-
Feb 16th, 2002, 06:49 PM
#2
Member
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 =)
-
Feb 16th, 2002, 07:00 PM
#3
Thread Starter
New Member
alright.. but how do i go on about doing that? Sample code anyone? =)
-
Feb 16th, 2002, 07:11 PM
#4
altho it isnt an API call, ues AppActivate to switch to notepad once u have found the window. just a sugestion.
-
Feb 17th, 2002, 04:49 AM
#5
Thread Starter
New Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|