|
-
Dec 31st, 2004, 09:07 PM
#1
Re: send message problem
Hey Tec
This seems to work
visual basic code:Me.Hide
DoEvents
gethwnd
Me.Show
It doesn't have time to hide your application and set focus to the notepad or whatever application you expect to have focus. I think
Thanks manavo, this cretainly fixes the reliability problem for using to notepad or to my copiled vb program.
if MS word or a different project vbide window nothing pastes, but i will compile this now and test a lot more.
thanks again
-
Dec 31st, 2004, 09:40 PM
#2
-
Jan 1st, 2005, 12:25 AM
#3
Re: send message problem
hahaha
the program i mainly wanted to use this with (which isn't on my computer) doesn't get the paste, like Word, can i try to sendmessage the listbox text, instead of using sendmessage paste, (bypass the clipboard) and what would be the sendmessage command to do it.
p.
-
Jan 3rd, 2005, 06:48 PM
#4
-
Jan 3rd, 2005, 07:46 PM
#5
Hyperactive Member
Re: send message problem
Your sendmessage declaration is wrong, that's why it doesn't work, but the syntax is right.
If you're using WM_, you must change sendmessage declaration. Last parameter (lParam as any) must be ByVal lParam As String.
The modified sendmessage is often refered to as SendMessageByString
Original sendmessage:
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Modified sendmessage:
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
-
Jan 3rd, 2005, 08:06 PM
#6
Re: send message problem
dmitri
Modified sendmessage:
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
i changed my program to use the modified send message,
it still pastes fine into notepad, but nothing pastes to msword
thanks peter
-
Jan 3rd, 2005, 08:36 PM
#7
Hyperactive Member
Re: send message problem
Hmm, maybe wm_settext doesn't work with msword.
As far as I can think right now, keyb_event is your only option, but someone may know a way.
Post the code if not a problem. I'll tinker with it.
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
|