|
-
Jun 10th, 2013, 07:29 PM
#1
Re: SendMessage only works once on same object
MAX, I thought that BM_CLICK was both mouse down and mouse up (hence Click).
I'll try adding a BM_MOUSEUP and see what happens. Thanks for the thought, however.
Last edited by jmsrickland; Jun 10th, 2013 at 07:46 PM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jun 10th, 2013, 09:46 PM
#2
Re: SendMessage only works once on same object
 Originally Posted by jmsrickland
MAX, I thought that BM_CLICK was both mouse down and mouse up (hence Click).
I'll try adding a BM_MOUSEUP and see what happens. Thanks for the thought, however.
BM_CLICK is the same as sending WM_LBUTTONDOWN and WM_LBUTTONUP, so no need to send more messages!
First thing to check is your API declare, SendMessageByString just sounds wrong, you should be using the normal Sendmessage API as it is in the VB6 API viewer, bm_click should be sent as a long in VB6 and not a string!
Remember when using sendmessage... if app2 goes into a busy loop after receiving a message from app1 then app1 will freeze until app2 finishes the work or calls DoEvents, also if app2 is in a busy loop it will not act upon messages, use timers and/or call doevents as needed, You may also want to look up and read about PostMessage and SendMessageTimeOut and see how they differ.
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
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
|