|
|
|
When the user clicks on an iconized (minimized) form in the taskbar, Windows sends that form a WM_QUERYOPEN message, and inspects the value returned to the operating system. If this value is zero, the operation is canceled.
Using subclassing you can therefore determine when a form is about to be restored, and you can also refuse to restore it by returning 0. Here is a code snippet that does the trick: |
Click here to copy the following block |
Const WM_QUERYOPEN = &H13
Dim WithEvents FormHook As MsgHook
Private Sub Form_Load() Set FormHook = New MsgHook FormHook.StartSubclass hWnd End Sub
Private Sub FormHook_AfterMessage(ByVal uMsg As Long, ByVal wParam As Long, _ ByVal lParam As Long, retValue As Long) If uMsg = WM_QUERYOPEN Then End If End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|