MsgBoxA API Import c#
// Sample program to call unmanaged code
using System;
using System.Runtime.InteropServices;
class PInvoke1App
{
[DllImport("user32.dll")]
static extern int MessageBoxA(int hWnd, string strMsg, string strCaption, int iType);
public static void Main()
{
MessageBoxA(0, "Hello, World!", "This is called from a C# app!", 0);
}
}
Aucun commentaire:
Enregistrer un commentaire