Results 1 to 4 of 4

Thread: Mouse Events

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Question

    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.

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Member
    Join Date
    Nov 2000
    Location
    Manila, Philippines
    Posts
    51

    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
    Programmers dont byte, they just nibble a bit.

  4. #4

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Arrow 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width