Imports System.Runtime.InteropServices

Public Class Win32
    '    Declare Auto Function MessageBox Lib "user32.dll" (ByVal hWnd As Integer, _
    '    ByVal txt As String, ByVal caption As String, ByVal Typ As Integer) As Integer
    <DllImport("USER32.DLL", CharSet:=CharSet.Unicode)> _
    Public Shared Function _
    MessageBox(ByVal hWnd As Integer, ByVal txt As String, ByVal caption As String, ByVal Type As Integer) As Integer
    End Function
End Class

Public Class HelloWorld
    Public Shared Sub Main()
        Win32.MessageBox(0, "Witaj świecie z VB!", "Przykład Platform Invoke", 0)
    End Sub
End Class