using System;
using System.Runtime.InteropServices;
namespace 调用Win32的MessageBox
{
    
class Class1
    {
        [STAThread]
        
static void Main(string[] args)
        {
            Class1.MessageBox(
0,"auto","infomation",0);

            Class1.MessageBoxA(
0,"ANSI我","infomation",0);

            Class1.MessageBoxW(
0,"Unicode我","infomation",0);
        }
        [DllImport(
"user32.dll",CharSet=CharSet.Auto)]
        
public static extern int MessageBox(int hWnd,string text,string caption,uint type);

        [DllImport(
"user32.dll",CharSet=CharSet.Ansi)]
        
public static extern int MessageBoxA(int hWnd,string text,string caption,uint type);
      
        [DllImport(
"user32.dll",CharSet=CharSet.Unicode)]
        
public static extern int MessageBoxW(int hWnd,string text,string caption,uint type);

    }
}

相关文章:

  • 2021-10-29
  • 2021-11-17
  • 2021-11-17
  • 2021-11-08
  • 2021-07-13
  • 2022-02-02
猜你喜欢
  • 2021-12-16
  • 2022-12-23
  • 2021-08-22
  • 2021-07-17
  • 2021-12-26
  • 2022-02-28
  • 2021-11-19
相关资源
相似解决方案