SendMessage Help

My VB6 code:

Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA"(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As Any) As Integer

Anyone know how to fix for 2005


Answer this question

SendMessage Help

  • Gurpreet Singh Gill

     

    All those integers were 16 bits entities in vb6.

    This is what I have for vb6:

    Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long

    Changing the longs to integers is correct.......

    I'd just change the Asany to Integer also and try it out.
     

     



  • tun

    I got it, changing As Any to As String. ;)
  • MrLucky

    I wouldn't have guessed that from looking at the declaration.



  • TrevorW

    I have used this sucessfully:

    Private Declare Function SendMessage Lib "USER32" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wp As IntPtr, ByVal lp As IntPtr) As IntPtr



  • SendMessage Help