[DllImport("user32.dll")]
public static extern int MessageBoxTimeoutA(IntPtr hWnd, string msg, string Caps, int type, int Id, int time);//引用DLL
//MessageBoxTimeoutA((IntPtr )0,"3秒后自动关闭","消息框",0,0,3000);// 直接调用 3秒后自动关闭 父窗口句柄没有直接用0代替
原文:https://www.cnblogs.com/dangpengfei/p/12766281.html