I like to have a msgbox appear when the title bar get click.
Printable View
I like to have a msgbox appear when the title bar get click.
You have to subclass the form.
Put this in a module:
When A form loads:Code:Public oldp As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const WM_NCLBUTTONDOWN = &HA1
Public Const GWL_WNDPROC = (-4)
Public Function WindowProc(ByVal hwnd As Long, ByVal uMsg As Long,ByVal wParam As Long, ByVal lParam As Long) As Long
If uMsg = WM_NCLBUTTONDOWN Then
MsgBox("text")
End If
WindowProc = CallWindowProc(oldp, hwnd, uMsg, wParam, lParam)
End Function
Code:oldp = SetWindowLong(Form1.hwnd, GWL_WNDPROC, AddressOf WindowProc)
[Edited by Vlatko on 10-10-2000 at 07:37 PM]
Joacim Andersson has a good example in this thread :rolleyes:.
It works!!!! Vlatko
Thanks Matthrew for the infor but Joacim's example just closed my vb application. I tried it 3 times.