procedure MyShowMessage(Msg:string;Delay:DWord=2); var FForm:TForm; StartT:DWord; begin FForm:=TForm.Create(Application); With FForm do begin FormStyle:=fsStayOnTop; Font.Name:='宋体'; Font.Size:=9; Width:=100; Height:=30; Canvas.Font:=Font; Position:=poDesktopCenter; end; SetWindowLong(FForm.Handle,GWL_STYLE,GetWindowLong(FForm.Handle,GWL_STYLE) and (not WS_CAPTION)); FForm.Height:=FForm.ClientHeight; With TLabel.Create(FForm) do begin Caption:=Msg; Parent:=FForm; end; StartT:=GetTickCount; FForm.Show; while (GetTickCount-StartT)<Delay*1000 do Application.ProcessMessages; FForm.Free; end;
EndDialog(hDialog, IDOK);
var
FForm:TForm;
StartT:DWord;
begin
FForm:=TForm.Create(Application);
With FForm do
begin
FormStyle:=fsStayOnTop;
Font.Name:='宋体';
Font.Size:=9;
Width:=100;
Height:=30;
Canvas.Font:=Font;
Position:=poDesktopCenter;
end;
SetWindowLong(FForm.Handle,GWL_STYLE,GetWindowLong(FForm.Handle,GWL_STYLE) and (not WS_CAPTION));
FForm.Height:=FForm.ClientHeight;
With TLabel.Create(FForm) do
begin
Caption:=Msg;
Parent:=FForm;
end;
StartT:=GetTickCount;
FForm.Show;
while (GetTickCount-StartT)<Delay*1000 do
Application.ProcessMessages;
FForm.Free;
end;