Results 1 to 4 of 4

Thread: mouse click event on window application

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    mouse click event on window application

    Is there a mouse click event in vb6? I would like if the user clicks on the "minimize" button on the application window, it does something. How to accomplish that?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: mouse click event on window application

    Use the Form_Resize event, eg:
    Code:
    Private Sub Form_Resize()
    
      If Me.WindowState = vbMinimized Then
        'do something
      End If
    
    End Sub

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,170

    Re: mouse click event on window application

    Sorry for not making it clear.

    Is there a way to detect windows explorer's mouse click event? For example, I write an exe to launch the windows explorer program, then when the user clicks on the "minimize" button, my code should do something.

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: mouse click event on window application

    You would need to hook (subclass) the explorer window, and respond to the appropriate message.

    I would recommend checking out these CodeBank threads for examples of hooking external windows:
    Subclassing an external window
    Subclass External Programs done for you

    Use a program like spy++ to find out what messages to respond to.

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