⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.pas

📁 Delphi + MapX程序框架(地图)源码程序
💻 PAS
字号:
unit Global;

interface

uses Forms, Windows, Messages, SysUtils ;

const
  CM_BASE = WM_USER;

type
  TRunDLL = function(App: TApplication; Scr: TScreen; Int: Integer): HRESULT;

function RunDLL(dllPath: string; Int: Integer): HRESULT;
function GetLongPathName(APath:String):String;

implementation

function RunDLL(dllPath: string; Int: Integer): HRESULT;
var
  DLLHandle: THandle;
  DLLProcedure: TRunDLL;
begin
  DLLHandle := LoadLibrary(pChar(dllPath));
  if DLLHandle <> 0 then
  begin
    @DLLProcedure := GetProcAddress(DLLHandle, 'DLLProcedure');
    if Assigned(DLLProcedure) then
    begin
      Result:= DLLProcedure(Application, Screen, Int);
    end;
  end;
end;

function GetLongPathName(APath: String):String;
var
  APos : Integer;
  AHandle : THandle;
  Data : TWin32FindData;
  IsBackSlash : Boolean;
begin
  APath:= ExpandFileName(APath);
  APos:= Pos('\',APath);
  Result:= Copy(APath,1,APos);
  Delete(APath,1,APos);
  repeat
    APos:= Pos('\',APath);
    IsBackSlash:= APos > 0;
    if Not IsBackSlash then
      APos:= Length(APath)+1;
    AHandle:= FindFirstFile(PChar(Result+Copy(APath,1,APos-1)),Data);
    if AHandle <> INVALID_HANDLE_VALUE then
    begin
      try
        Result:= Result+Data.cFileName;
        if IsBackSlash then Result:=Result+'\';
      finally
        Windows.FindClose(AHandle);
      end;
    end
    else begin
      Result:=Result+APath;
      Exit;
    end;
    Delete(APath,1,APos);
  until Length(APath) = 0;
end;


end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -