Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...