使任何消息框和对话框具有<自动关闭>的功能(0分)

  • 主题发起人 主题发起人 lich
  • 开始时间 开始时间
L

lich

Unregistered / Unconfirmed
GUEST, unregistred user!
<br>http://www.playicq.com/dispdocnew.php?id=13771<br>呵呵,觉得好用,就给几分吧(要么就不给,要么就给至少50)<br>
 
要钱的。
 
您等级不够或没有积分,无法下载,请充值!
 
resourcestring<br>&nbsp; M_CAPTION = '提示';<br>......<br>function EnumFunc(hwnd: THandle; lpParam: Integer): Boolean; stdcall;<br>var<br>&nbsp; Buffer: array [0..MAX_TITLE - 1] of Char;<br>begin<br>&nbsp; Result := True;<br>&nbsp; FillChar(Buffer, SizeOf(Buffer), 0);<br>&nbsp; if GetWindowText(hwnd, Buffer, SizeOf(Buffer)) &gt; 0 then<br>&nbsp; &nbsp; if PData(lpParam)^.Title = Buffer then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; PData(lpParam)^.hwnd := hwnd;<br>&nbsp; &nbsp; &nbsp; Result := False;<br>&nbsp; &nbsp; end;<br>end;<br><br>procedure TimerFunc(hwnd: THandle; uMsg, idEvent: UINT; dwTime: Cardinal); stdcall;<br><br>&nbsp; function GetTitleHandle(Title: string): THandle;<br>&nbsp; var<br>&nbsp; &nbsp; Data: TData;<br>&nbsp; begin<br>&nbsp; &nbsp; FillChar(Data, SizeOf(Data), 0);<br>&nbsp; &nbsp; Move(Title[1], Data.Title, Length(Title));<br>&nbsp; &nbsp; EnumWindows(@EnumFunc, Integer(@Data));<br>&nbsp; &nbsp; Result := Data.hwnd;<br>&nbsp; end;<br><br>var<br>&nbsp; Child: THandle;<br>begin<br>&nbsp; Child := GetTitleHandle(M_CAPTION);<br>&nbsp; if Child &lt;&gt; 0 then<br>&nbsp; &nbsp; PostMessage(Child, WM_CLOSE, 0, 0);<br>end;<br>function SplashMsgBox(const Handle: THandle; const Text: string; const aiTimeout: Integer): Integer;<br>begin<br>&nbsp; SetTimer(Handle, 2, aiTimeout, @TimerFunc);<br>&nbsp; Result := MessageBox(Handle, PChar(Text), PChar(M_CAPTION),<br>&nbsp; &nbsp; MB_OKCANCEL or MB_ICONQUESTION); { MB_OKCANCEL do not localize !! }<br>&nbsp; KillTimer(Handle, 2);<br>end;
 
呵呵,看看我的吧,能倒计时,还能取消此过程<br>有的朋友说需要加一个方法来判断是否是自动关闭的,<br>这个还没有加上,有兴趣的就帮着加一下了<br><br>playicq上面的下载地址:<br>ftp://new1:r5fde3ss@61.129.70.192/datanew/2004030716041817716.rar
 
接受答案了.
 
后退
顶部