<div>Trying to implement a win messagebox with timeout, I googled & found a mention of an undocumented messageboxtimeout api & its delphi call. </div><div><br></div><div>See noddy program below - works for messagebox() with boolean false, unfortunately fails with boolean true & gives 'not found in user32' message in my xp.</div>
<div><br></div><div>Anyone know if there is a messageboxtimeout or similar functionality in win or a  fpc implementation of this? </div><div><br></div><div>John </div><div><br></div><div>uses windows;</div><div>function MessageBoxtimeout(w1:longint;l1,l2:pointer;w2:longint;l,t:longint)</div>
<div> :longint; stdcall; external 'user32' name 'MessageBoxtimeoutA';</div><div>function MessageBox(w1:longint;l1,l2:pointer;w2:longint)</div><div> :longint; stdcall; external 'user32' name 'MessageBoxA';</div>
<div><br></div><div>var errorbuf:string;</div><div>    l,n,t:longint;</div><div><br></div><div>begin</div><div> errorbuf:='1234567';</div><div> l:=0;</div><div> t:=1000;</div><div> if false</div><div>  then</div><div>
   n:=MessageBoxtimeout(0,@ErrorBuf[1],pchar('Error'),0,l,t)</div><div>  else</div><div>   n:=MessageBox(0,@ErrorBuf[1],pchar('Error'),0);</div><div> writeln(n);</div><div><br></div><div>end.</div><br>