Leaders dynamic_sysop Posted May 5, 2003 Leaders Posted May 5, 2003 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:confused: is there an equivalent in Dot Net? my test to see if i could get it to work ( in a module ) is this... 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 and on the form ( in a button_click ) this... OldWindowProc = SetWindowLong(TextBox1.Handle.ToInt32, GWL_WNDPROC, " THIS IS WHERE THE ADDRESSOF SHOULD GO")'// HERE IT SAYS THAT I CANT USE ADDRESSOF any help appreciated thanx. Quote
*Gurus* divil Posted May 5, 2003 *Gurus* Posted May 5, 2003 The correct way to subclass in the .NET framework is to inherit from that control and override the WndProc method. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.