01 references
[DllImport("user32.dll")] public static extern int MessageBoxTimeoutA(IntPtr hWnd, string msg, string Caps, int type, int Id, int time); //引用DLL
02 calling code
MessageBoxTimeoutA ((IntPtr) 0 , " 3 seconds off automatically " , " message box " , 64 , 0 , 2000 ); // directly after 3 seconds off automatically calls
03 typede type value
04 Return Values
05 The question now is how the countdown? (After write)
06 actual cases
public partial class MainWindow : Window { [DllImport("user32.dll")] public static extern int MessageBoxTimeoutA(IntPtr hWnd, string msg, string Caps, int type, int Id, int time); //引用DLL public MainWindow() { InitializeComponent(); } private void Button_Click(object sender, RoutedEventArgs e) { MessageBoxTimeoutA ((IntPtr) 0 , " 3 seconds off automatically " , " message box " , 64 , 0 , 2000 ); // close automatically invoked directly after 3 seconds } }