代码拉取完成,页面将自动刷新
unit first;
{$mode objfpc}{$H+}
interface
{$ifdef windows}
uses
betterDLLSearchPath, Classes, SysUtils;
{$endif}
implementation
{$ifdef windows}
uses windows, registry, Win32Int;
procedure setDPIAware; //won't work in windows 10 anymore
type
PROCESS_DPI_AWARENESS=(PROCESS_DPI_UNAWARE=0, PROCESS_SYSTEM_DPI_AWARE=1, PROCESS_PER_MONITOR_DPI_AWARE=2);
var
SetProcessDpiAwareness:function(value: PROCESS_DPI_AWARENESS):HRESULT; stdcall;
SetProcessDPIAware:function: BOOL; stdcall;
l: HModule;
begin
OutputDebugString('setDPIAware');
l:=LoadLibrary('Shcore.dll');
if l<>0 then
begin
farproc(SetProcessDpiAwareness):=GetProcAddress(l,'SetProcessDpiAwareness');
if assigned(SetProcessDpiAwareness) then
begin
// OutputDebugString('p1');
SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE);
exit;
end;
end;
//still here, probably win8.0 or 7
l:=LoadLibrary('user32.dll');
if l<>0 then
begin
// OutputDebugString('p2');
farproc(SetProcessDPIAware):=GetProcAddress(l,'SetProcessDPIAware');
if assigned(SetProcessDPIAware) then
SetProcessDPIAware;
end;
OutputDebugString('p3');
end;
var
i: integer;
istrainer: boolean;
r: TRegistry;
hassetdpiaware: boolean;
initialization
//todo, check registry if not a trainer
istrainer:=false;
hassetdpiaware:=false;
for i:=1 to Paramcount do
begin
if ParamStr(i)='DPIAWARE' then
begin
setDPIAware;
hassetdpiaware:=true;
end;
if pos('.CETRAINER', uppercase(ParamStr(i)))>0 then
istrainer:=true;
end;
if not (istrainer or hassetdpiaware) then
begin
//check the registry
r := TRegistry.Create;
r.RootKey := HKEY_CURRENT_USER;
if r.OpenKey('\Software\Cheat Engine',false) then
begin
if (r.ValueExists('DPI Aware')=false) or r.ReadBool('DPI Aware') then
setDPIAware;
end
else
begin
//first time CE is ran, and not a trainer.
if r.OpenKey('\Software\Cheat Engine',true) then
begin
//I do have access
setDPIAware; //default config is enabled
r.WriteBool('DPI Aware', true);
end;
end;
r.free;
r:=nil;
end;
{$endif}
end.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。