I would like to know how you can clear the mouse clicks. Here is my problem.
I use an image as a button with mouse_move, mouse_up and mouse_down events. But what happens is that when I click once, if I click to fast a seconde time, the down effect of the button won't happen because the system taks the other click as a double click instead of a seperate new click.
I would like to know if there is a way I can flush the last click so that the system does not count it as first click in a double click. In that case the button will reply to the mouse down event and not the mouse_dblclick event.
I cannot move to VB.NET so I need to work with VB6. All my applications are with VB6. The DoEvent does not work. I really need to flush the last click event of the mouse.
Please do not suggest to move to VB.NET any more. I posted the request here in the VB6 forums because that is what I need. I know VB.NET is better and take's in charge a lot more stuff but I'm used to VB6 and that is the environment I am using.
You could just place code in the double click event that calls the code ran by the mouse down. Assuming that the mouse down event is not already running when they do this. Seems simple enough.
I cannot disable the click because the user needs to be able to click several times on the image. And, I cannot also use the DblClick event because there is no control over the mouse button pressed. I really need to flush the mouse buffer.
I tried a lot of stuff and nothing works. I found out a small piece of code but it does not do exactly what I want.
Code:
Private Const PM_REMOVE = &H1
Private Const WM_MOUSEFIRST = &H200
Private Const WM_MOUSELAST = &H209
Type POINT_TYPE
x As Long
y As Long
End Type
Private Type Msg
hWnd As Long
message As Long
Wparam As Long
Lparam As Long
time As Long
pt As POINT_TYPE
End Type
Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" _
(lpMsg As Msg, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, _
ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
Public Sub ClearMouseBuffer(ByVal oFrm As Form)
Dim MOUSE_MSG As Msg
PeekMessage MOUSE_MSG, oFrm.hWnd, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE
End Sub
If someone has an idea, this will help me a lot.
Thanks for your comments and time for trying to help me out.
I would like to know how you can clear the mouse clicks. Here is my problem.
I use an image as a button with mouse_move, mouse_up and mouse_down events. But what happens is that when I click once, if I click to fast a seconde time, the down effect of the button won't happen because the system taks the other click as a double click instead of a seperate new click.
I would like to know if there is a way I can flush the last click so that the system does not count it as first click in a double click. In that case the button will reply to the mouse down event and not the mouse_dblclick event.
Thanks in advance.
I've your same problem , have you found a solution ? Many thanks
No I did not find a solution in that direction. I did do a work arround but it does not relate to this. I had to find another solution much more complexe which does not not implicate mouse clicks.
Yes, I had the same problem. DataMiser's idea is right.
What I did:
Code:
Private sub imgButton_DblClick()
imgButton_MouseDown 0,0,0,0
End Sub
The double-click is then retransfered to the mouse_down() code.
It worked very well for me. I could then click as fast as possible to achieve all mose-down code.
Very easy solution...
Yes, I had the same problem. DataMiser's idea is right.
What I did:
Code:
Private sub imgButton_DblClick()
imgButton_MouseDown 0,0,0,0
End Sub
The double-click is then retransfered to the mouse_down() code.
It worked very well for me. I could then click as fast as possible to achieve all mose-down code.
Very easy solution...
Very nice indeed. Thanks for teaching me this as well
Bookmarks