1 Star 0 Fork 0

phy0292/cheat-engine

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
frmBusyUnit.pas 3.49 KB
一键复制 编辑 原始数据 按行查看 历史
Dark Byte 提交于 2020-12-11 06:39 +08:00 . dark mode support
unit frmBusyUnit;
{$mode objfpc}{$H+}
interface
uses
{$ifdef windows}
windows,
{$endif}
{$ifdef darwin}
macport,
{$endif}
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls, memscan, syncobjs, betterControls;
type
{ TfrmBusy }
TfrmBusy = class(TForm)
Label1: TLabel;
Timer1: TTimer;
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
procedure FormShow(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ private declarations }
oktoclose: boolean;
fReason: TPostScanState;
procedure setReason(r: TPostScanState);
public
{ public declarations }
{$IFDEF windows}
WaitForHandle: THandle;
{$ENDIF}
{$ifdef darwin}
WaitForEvent: TEvent;
{$endif}
memscan: TMemScan;
property reason: TPostScanState read fReason write setReason;
end;
resourcestring
rsBusy='The previous scan is still being processed. Please wait';
rsJustFinished = '(Just starting to process)';
rsOptimizingScanResults = '(Optimizing result list for improved speed)';
rsTerminatingThreads = '(Freeing scanner thread memory)';
rsSavingFirstScanResults = '(Copying results for first scan scanner option)';
rsShouldBeFinished = '(There''s no reason to wait)';
rsSavingFirstScanResults2 = '(Still copying the results for the first scan '
+'scanner option)';
implementation
{$R *.lfm}
{ TfrmBusy }
procedure TfrmBusy.setReason(r: TPostScanState);
var reasonstr: string;
begin
if r<>fReason then
begin
freason:=r;
reasonstr:=#13#10;
case r of
psJustFinished: reasonstr:=reasonstr+rsJustFinished;
psOptimizingScanResults: reasonstr:=reasonstr+rsOptimizingScanResults;
psTerminatingThreads: reasonstr:=reasonstr+rsTerminatingThreads;
psSavingFirstScanResults: reasonstr:=reasonstr+rsSavingFirstScanResults;
psShouldBeFinished: reasonstr:=reasonstr+rsShouldBeFinished;
psSavingFirstScanResults2: reasonstr:=reasonstr+rsSavingFirstScanResults2
else
reasonstr:='';
end;
label1.caption:=rsBusy+reasonstr;
end;
end;
procedure TfrmBusy.FormShow(Sender: TObject);
begin
timer1.enabled:=true;
end;
procedure TfrmBusy.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin
canclose:=oktoclose;
end;
procedure TfrmBusy.Timer1Timer(Sender: TObject);
var
{$ifdef windows}
r:dword;
{$endif}
{$ifdef darwin}
r: TWaitResult;
{$endif}
begin
{$IFDEF windows} if (WaitForHandle<>0) then {$ENDIF}
{$IFDEF darwin} if (WaitForEvent<>nil) then {$ENDIF}
begin
{$IFDEF darwin}
r:=WaitForEvent.WaitFor(50);
if r<>wrTimeout then
begin
oktoclose:=true;
if fsModal in FFormState then
begin
if r=wrSignaled then
modalresult:=mrok
else
modalresult:=mrcancel;
end
else
close;
end;
{$ENDIF}
{$ifdef windows}
r:=WaitForSingleObject(WaitForHandle, 50);
if r<>WAIT_TIMEOUT then
begin
oktoclose:=true;
if fsModal in FFormState then
begin
if r=WAIT_OBJECT_0 then
modalresult:=mrok
else
modalresult:=mrcancel;
end
else
close;
end;
{$endif}
end;
if (memscan<>nil) and (reason<>memscan.postscanstate) then
begin
reason:=memscan.postScanState;
end;
end;
initialization
end.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/phy0292/cheat-engine.git
git@gitee.com:phy0292/cheat-engine.git
phy0292
cheat-engine
cheat-engine
master

搜索帮助