-
Does anybody know how to force a window to respond to mouse events (if it is not already) like VB's MsgBox.
It has focus and is responding to keyboard operations but will not respond to mouse clicks.
It's too complicated to explain why I'm in this situation but if anybody knows of a suitable API call it would be much appreciated.
Simon.
-
<?>
Dumb question on my part, but do you have the coresponding
code in the form click event?
Code:
Private Sub Form_Click()
MsgBox "help"
End Sub
-
weird
Well, you are saying that a windows message box does NOT respond to mouse clicks ?!
Weird.
When you click anything on a message box (i.e. the buttons), it does not respond ?! Well, then maybe its a bug or something... but there is also a Win32 API that you may wanna try playing around with: SendMessage, PostMessage.
Both of them sends messages to a window, like for example, a MouseMove... or for yer case, a mouse click. It is hard for me to explain all those in here... perhaps, you could get a Win32 API book and look up this information...
There are also websites and resources:
http://www.allapi.net --- download their API Guide, and API ToolShed. That will help you a lot.(Well, it helped me) :)
or
http://www.vbapi.com --- if you want an online explanation of windows messages and how to use them. (in yer case, MouseClick - WM_LMOUSEDOWN <--- I hope this is the right constant)
(But, why do you have to force it to respond anyway? Do you really have to?)
Anyway, just look it up. its a good start.
:) Jonn
-
What I meant...
Is that I have a form that doesn't respond, not a message box.
I mentioned he message box as it manages to force itself to respond to mouse events (unlike my form).
And as it happens, I have found a solution:
Private Sub Form_Activate()
SetCapture Me.hWnd
ReleaseCapture
End Sub
SetCapture and ReleaseCapture are Win32 API's.
Thanks for you time though,
Simon.