Code:
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Const GWL_WNDPROC = (-4)
Public Const WM_NCLBUTTONDOWN = &HA1
Public Const WM_NCLBUTTONUP = &HA2
Public Const HTMAXBUTTON = 9
Public OldWndProc As Long
Public TheText  As String

Public Function WindProc(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    If wMsg = WM_NCLBUTTONDOWN Then
        If wParam = HTMAXBUTTON Then
            TheText = "hello"
        End If
    End If
    WindProc = CallWindowProc(OldWndProc, hwnd, wMsg, wParam, lParam)
End Function

Public Sub Hook(hwnd As Long)
    OldWndProc = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf WindProc)
End Sub

Public Sub UnHook(hwnd As Long)
    SetWindowLong hwnd, GWL_WNDPROC, OldWndProc
    OldWndProc = 0
End Sub
<mindless rambling>
damnit! I hate it when that happens I typed out the whole message, then hit the escape key(it deletes everything in a textbox)
</>
I just recently found out about the wonderful world of subclassing, I modeled this example from Megatrons code to minimize the window to the systray instead of to the taskbar. (my code works BTW, so that isnt what the question is about)

what else can I have for wParam?
I have HTMAXBUTTON, but I know that cant be all you can have...

I would really appreciate some help

Thanks,
Dennis.