WinForm 定时器 定时弹出提示框并关闭
#region 弹框提示并自动关闭 (目的:延迟拍照) /// <summary> /// 关闭标志 /// </summary> private const int WM_CLOSE = 0x0010; /// <summary> /// 弹框标题, const 类型以便访问查找 /// </summary> private const string WM_CLOSE_TITLE = "存储中..."; /// <summary> /// 定时器回调函数 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TimerCallBack(object sender, EventArgs e) { IntPtr ptr = DllUtil.FindWindow(null, WM_CLOSE_TITLE); // ** 调用本地方法查找弹框的窗体指针 if (ptr != IntPtr.Zero) { DllUtil.PostMessage(ptr, WM_CLOSE, 0, 0); // ** 发送窗体关闭消息 } ((System.Windows.Forms.Timer)sender).St