其他分享
首页 > 其他分享> > delphi 不阻塞提示对话框

delphi 不阻塞提示对话框

作者:互联网

{不阻塞提示对话框  TimeOut 超时参数,多久没有回应。超过时间则返回 IDTIMEOUT  默认0无限等待

返回:
IDABORT (3)
Abort

IDCANCEL (2)
Cancel

IDCONTINUE (11)
Continue

IDIGNORE (5)
Ignore

IDNO (7)
No

IDOK (1)
OK

IDRETRY (4)
Retry

IDTRYAGAIN (10)
Try Again

IDYES (6)
Yes

IDASYNC (32001 (0x7D01))
The bWait parameter was FALSE, so the function returned without waiting for a response.

IDTIMEOUT (32000 (0x7D00))
The bWait parameter was TRUE and the time-out interval elapsed.
}
function NoblockingMessageBox(aMessage:string;Buttons: DWORD=MB_OK;TimeOut:integer=0):DWORD;
begin
  WTSSendMessage(WTS_CURRENT_SERVER_HANDLE, WTSGetActiveConsoleSessionId,
    PChar(Application.Title), Length(Application.Title), PChar(aMessage), Length(aMessage), Buttons, TimeOut, Result, False);
end;

{ *** *** *** *** *** *** *** *** *** *** *** *** 函数 *** *** *** *** *** *** *** *** *** *** *** *** }

弹出对话框后,还会执行下面的代码。对话框独立于EXE外

标签:TimeOut,Title,delphi,对话框,阻塞,Buttons,Length,aMessage
来源: https://www.cnblogs.com/BTag/p/15735713.html