Skip to content

Instantly share code, notes, and snippets.

@un4ckn0wl3z
Created March 19, 2023 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save un4ckn0wl3z/f6b36a451eb791f88262b288f091fb87 to your computer and use it in GitHub Desktop.
Save un4ckn0wl3z/f6b36a451eb791f88262b288f091fb87 to your computer and use it in GitHub Desktop.
using System;
using System.Runtime.InteropServices;
namespace PInvoke
{
internal class Program
{
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
static extern int MessageBoxW(IntPtr hWnd, string lpText, string lpCaption, uint uType);
static void Main(string[] args)
{
MessageBoxW(IntPtr.Zero, "My first P/Invoke", "Hello World", 0);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment