www.pudn.com > QQ2009.rar > mMenuProc.bas, change:2009-11-15,size:644b


Attribute VB_Name = "mMenuProc" 
 
 
Option Explicit 
 
Dim OldWndProc As Long 
 
Public MenuShown As Boolean 
 
Public Function WndProc(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long 
    If uMsg = WM_NCACTIVATE And wParam = 0 And MenuShown Then 
        Unload frmMenu 
    End If 
     
    WndProc = CallWindowProc(OldWndProc, hWnd, uMsg, wParam, lParam) 
End Function 
 
Public Sub SubClass(ByVal hWnd As Long) 
    OldWndProc = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf WndProc) 
End Sub 
 
Public Sub UnSubClass(ByVal hWnd As Long) 
    SetWindowLong hWnd, GWL_WNDPROC, OldWndProc 
End Sub