Friend Declare Auto Function GetWindowLong Lib "user32.dll" (ByVal hwnd As Int32, ByVal nIndex As WindowLongs) As Int32
Friend Enum WindowLongs As Int32
GWL_EXSTYLE = -20
GWL_STYLE = -16
GWL_WNDPROC = -4
GWL_HINSTANCE = -6
GWL_HWNDPARENT = -8
GWL_ID = -12
GWL_USERDATA = -21
DWL_DLGPROC = 4
DWL_MSGRESULT = 0
DWL_USER = 8
End Enum
In order to obtain current wnd proc of window, you can use this declaration:
Friend Declare Auto Function GetWindowLong Lib "user32.dll" (ByVal hwnd As Int32, ByVal nIndex As WindowProcs) As Messages.WndProc
Public Delegate Function WndProc(ByVal hWnd As Integer, ByVal msg As Messages.WindowMessages, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Friend Enum WindowProcs As Int32
GWL_WNDPROC = WindowLongs.GWL_WNDPROC
DWL_DLGPROC = WindowLongs.DWL_DLGPROC
End Enum
WindwMessages is an enumeration of all known window messages and is of type Int32.
If such-declared function fails, return value is null (nothing).