using System;
using System.Collections.Generic;
using System.Text;
 
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            MessageBoxA(0,"Hello World!","My Message Box",0);
            Console.WriteLine("Over");
            Console.Read();
        }
 
        #region C++
        [System.Runtime.InteropServices.DllImport("user32.dll")]
        public static extern int MessageBoxA(
                int b,
                [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPStr)]string m,
                [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPStr)]string c,
                int type
            );
        #endregion
    }
}

 P/Invoke Tutorial: Basics (Part 1):
http://www.codeproject.com/Articles/403285/P-Invoke-Tutorial-Basics-Part-1
可以从这里下载现成的开发结构。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-05-11
  • 2021-12-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-07
  • 2021-09-16
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案