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?
Printable View
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?
Use the Form_Resize event, eg:
Code:Private Sub Form_Resize()
If Me.WindowState = vbMinimized Then
'do something
End If
End Sub
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.
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.