dynamic_sysop
Senior Contributor
hi again , i'm trying to impliment a "SetWindowLong" in vb.net , however i need to use the "AddressOf NewWindowProc" , but i get an error that it cant convert an "AddressOf" to a long
is there an equivalent in Dot Net? my test to see if i could get it to work ( in a module ) is this...
and on the form ( in a button_click ) this...
any help appreciated thanx.
is there an equivalent in Dot Net? my test to see if i could get it to work ( in a module ) is this...
Visual Basic:
Public Function NewWindowProc(ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Try
Select Case msg
Case WM_NCPAINT
Debug.Write("WM_PAINT " & wParam)
Case WM_LBUTTONUP
Debug.Write("WM_LBUTTONUP " & wParam)
Case Else
NewWindowProc = CallWindowProc(OldWindowProc, hwnd, msg, wParam, lParam)
End Select
DefWindowProc(hwnd, msg, wParam, lParam)
Catch
Debug.Write("An Error has occurred")
End Try
End Function
Visual Basic:
OldWindowProc = SetWindowLong(TextBox1.Handle.ToInt32, GWL_WNDPROC, " THIS IS WHERE THE ADDRESSOF SHOULD GO")'// HERE IT SAYS THAT I CANT USE ADDRESSOF