Results 1 to 4 of 4

Thread: Code C# to VB

  1. #1
    Join Date
    Oct 2005
    Posts
    449

    Code C# to VB

    Hi,
    I want to convert this C# code into VB.
    Please help.

    Code:
    private const int RF_TESTMESSAGE = 0xA123;
    
    [DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
    public static extern int SendMessage(IntPtr hwnd,
    [MarshalAs(UnmanagedType.U4)] int Msg, uint wParam, ulong lParam);
    Thanking you in advance.
    Determined and Forceful
    Emotional and Intuitive
    Powerful and Passionate
    Exciting and Magnetic

  2. #2
    Join Date
    Jan 2008
    Posts
    56

    Re: Code C# to VB

    Please try this code:-

    Code:
    Private Const RF_TESTMESSAGE As Integer = 41251
    
    <DllImport("user32.dll", CharSet := CharSet.Auto, SetLastError :=
    True)> _
    Public Shared Function SendMessage(ByVal hwnd As IntPtr,
    <MarshalAs(UnmanagedType.U4)> _
    ByVal Msg As Integer, ByVal wParam As UInteger, ByVal lParam As ULong)
    As Integer
    End Function
    Hope this works.

  3. #3
    Join Date
    May 2008
    Posts
    13

    Re: Code C# to VB

    Private Const RF_TESTMESSAGE As Integer = &HA123

    <DllImport("user32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
    Public Shared Function SendMessage(ByVal hwnd As IntPtr,
    <MarshalAs(UnmanagedType.U4)> ByVal Msg As Integer, ByVal wParam As UInteger,
    ByVal lParam As ULong) As Integer
    End Function

  4. #4
    Join Date
    Oct 2005
    Posts
    449

    Re: Code C# to VB

    Thanks for the quick reply.
    I will try both the solutions.
    Determined and Forceful
    Emotional and Intuitive
    Powerful and Passionate
    Exciting and Magnetic

Similar Threads

  1. Replies: 15
    Last Post: 02-05-2014, 03:00 PM
  2. startup error code:0x80090006 ,,unable to locate activation code
    By Mr.Walter in forum Windows XP Support
    Replies: 3
    Last Post: 04-01-2012, 06:08 PM
  3. Replies: 25
    Last Post: 28-12-2011, 07:58 PM
  4. Replies: 5
    Last Post: 08-07-2011, 07:53 PM
  5. Replies: 4
    Last Post: 05-10-2010, 07:08 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,643,128.43465 seconds with 16 queries