[TRUCOS DELPHI] Tipo de Ejecutable (Binario).
delphi
function getexetype(Filename:string):string; var BinaryType: DWORD; begin If GetBinaryType(Pchar(Filename), Binarytype) Then case BinaryType of SCS_32BIT_BINARY: Result:= 'Win32 executable'; SCS_DOS_BINARY : Result:= 'DOS executable'; SCS_WOW_BINARY : Result:= 'Win16 executable'; SCS_PIF_BINARY : Result:= 'PIF file'; SCS_POSIX_BINARY: Result:= 'POSIX executable'; SCS_OS216_BINARY: Result:= 'OS/2 16 bit executable' else Result:= 'unknown executable' end else Result:= 'File is not an executable'; end;
Ejemplo de uso:
delphi
procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption:=getexetype('c:\windows\notepad.exe'); end;
Saludos!