Trying to implement a win messagebox with timeout, I googled & found a
mention of an undocumented messageboxtimeout api & its delphi call.

See noddy program below - works for messagebox() with boolean false,
unfortunately fails with boolean true & gives 'not found in user32' message
in my xp.

Anyone know if there is a messageboxtimeout or similar functionality in win
or a  fpc implementation of this?

John

uses windows;
function MessageBoxtimeout(w1:longint;l1,l2:pointer;w2:longint;l,t:longint)
 :longint; stdcall; external 'user32' name 'MessageBoxtimeoutA';
function MessageBox(w1:longint;l1,l2:pointer;w2:longint)
 :longint; stdcall; external 'user32' name 'MessageBoxA';

var errorbuf:string;
    l,n,t:longint;

begin
 errorbuf:='1234567';
 l:=0;
 t:=1000;
 if false
  then
   n:=MessageBoxtimeout(0,@ErrorBuf[1],pchar('Error'),0,l,t)
  else
   n:=MessageBox(0,@ErrorBuf[1],pchar('Error'),0);
 writeln(n);

end.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to