Você está na página 1de 16

MAscara valor

###,##0.00

Login Integrado ao Active Directory


Primeiramente, vamos criar um novo projeto: File/New/VCL Forms Application -
Delphi. Neste exemplo, criei uma tela b�sica de Login, como segue:

Configure os componentes da seguinte forma:

O Active Directory Service Interfaces (ADSI) nos d� uma interface COM para
interagirmos com o Active Directory, portanto, vamos adicionar a unit ActiveX na
uses list para utilizarmos esta interface.

Para que possamos validar o login e a senha do usu�rio, necessitamos utilizar uma
interface requerida em objetos ADSI para capturar algumas propriedades e um m�todo
para comparar estas informa��es com os objetos do Active Directory. Para tanto,
adicionemos em nossa aplica��o as units ActiveDs_Tlb e Adshlp, as quais se
encontram no final deste artigo, juntamente com o c�digo fonte deste projeto-
exemplo, n�o se esquecendo de adicion�-las tamb�m � aplica��o.

Configure o evento onClick do btnLogin, como segue:

procedure TfrmLogin.btnLoginClick(Sender: TObject);


var
adObject: IADs;
begin
///Inicializa��o do COM
CoInitialize(nil);
try
ADsOpenObject('://',
LowerCase(edtUsuario.Text),
edtSenha.Text,
ADS_SECURE_AUTHENTICATION,
IADs,
adObject);
ShowMessage('Login v�lido!');
except
on e: EOleException do
begin
if Pos('Falha de logon', e.Message) > 0 then
ShowMessage('Login inv�lido!')
else
ShowMessage(e.Message);
end;
end;
CoUninitialize;
end;

Criando um arquivo de log


procedure AddLog;
var
log: textfile;
begin
try
AssignFile(log, 'c:\log.log');
if not FileExists('c:\log.log') then Rewrite(log,'c:\log.log');
Append(log);
WriteLn(log, 'informa��es a serem inclusas');
finally
CloseFile(log);
end;
end;

Determinar se uma janela (form) est� maximizada


Inclua na se��o uses: Windows

if IsZoomed(Form1.Handle) then
{ Form1 est� maximizado }
else
{ Form2 N�O est� maximizado }

Autor: Daniel P. Guimar�es


Home-page: www.tecnobyte.com.br

In�cio
Determinar se o aplicativo est� minimizado
Inclua na se��o uses: Windows

if IsIconic(Application.Handle) then
{ Minimizado }
else
{ N�o minimizado }

Observa��es

Pode-se verificar qualquer janela (form). S� um lembrete: quando clicamos no bot�o


de minimizar do form principal, na verdade ele � oculto e o Application � que �
minizado.

Function Nome_Computador():String;
var
registro : tregistry;
begin
registro:=tregistry.create;
registro.RootKey:=HKEY_LOCAL_MACHINE;
registro.openkey('System\CurrentControlSet\Services\VXD\VNETSUP',false);
result:=registro.readstring('ComputerName');
if result = '' then
begin

registro.openkey('System\CurrentControlSet\Control\ComputerName\
ComputerName',false);
Result:=registro.readstring('ComputerName');
end;
end;

function NomeComputador : String;


var
lpBuffer : PChar;
nSize : DWord;
const Buff_Size = MAX_COMPUTERNAME_LENGTH + 1;
begin
nSize := Buff_Size;
lpBuffer := StrAlloc(Buff_Size);
GetComputerName(lpBuffer,nSize);
Result := String(lpBuffer);
StrDispose(lpBuffer);
end;

Isso vai lhe permitir mudar a pasta do programa depois e as fotos ser�o
corretamente lidas.

2- Para salvar a foto como jpg


-declare jpeg na cl�usula uses superior;

procedure TfrCapturaFoto.botSalvarFotoClick(Sender: TObject);


Var
BMP : TBitMap;
JPG : TJpegImage;
Arq: String;
begin
VideoCap1.SaveToClipboard;
BMP := TBitMap.Create;
BMP.LoadFromClipboardFormat(cf_BitMap,ClipBoard.GetAsHandle(cf_Bitmap),0);

JPG := TJpegImage.Create;
JPG.Assign(BMP);
JPG.CompressionQuality:= 100;
JPG.Performance:= jpBestQuality;

Arq:= ExtractFilePath(ParamStr(0)) + 'fotos\'+tbAlufoto.AsString + '.jpg';

JPG.SaveToFile(Arq);

JPG.Free;
BMP.Free;

end;

Contar dias uteis entre intervalo de data

function Dias_Uteis(DataI, DataF:TDateTime):Integer;


var
contador:Integer;
begin
if DataI > DataF then
begin
result := 0;
exit
end;
Contador := 0;
while (DataI <= DataF) do
begin
if ((DayOfWeek(DataI) <> 1) and (DayOfWeek(DataI) <> 7)) then
Inc(Contador);
DataI := DataI + 1

end;
result := Contador;
end;

Extrair string de uma lista com separadores

function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PChar;


Strings: TStrings): Integer;

* Separator - � um array onde voc� pode definir v�rios separadores


* WhiteSpace - � um Array onde voc� define os caracteres que devem ser
Ignorados quando ocorrerem no inicio da String.
* Content - � a String de onde se deseja extrais as substrings

A Fun��o retorna o n�mero de Substrings extra�das.

Veja um pequeno exemplo de utiliza��o:

procedure TForm1.Button1Click(Sender: TObject);


const
SDados = 'Cristiano Martins Alves; 28 Anos; Casado; S�o Paulo; SP';
var
Lista: TStringList;
iRetorno:Integer;
begin
Lista := TStringList.Create;
try
iRetorno := ExtractStrings([';'],[' '],PChar(sDados),Lista);
if iRetorno > 0 then
ShowMessage(Lista.Text);
finally
FreeAndNil(Lista);
end;
end;

class function TFuncoesClass.TratarDiasUteis(data: TDate): TDate;

// Tratar final de semana, sabado e domingo jogar para segunda feira


function TratarFinalSemana(data: TDate): TDate;
begin
// Domingo - > + 1 para ir para segunda
if (DayOfWeek(data) = 1) then
Result := IncDay(data, 1)

// Sabado - > + 2 para ir para segunda


else if (DayOfWeek(data) = 7) then
Result := IncDay(data, 2)

// Segunda, ter�a, quarta, quinta, sexta - feira , resutlar a pr�pria data


else
Result := data;
end;

Contar dias uteis

function Dias_Uteis(DataI, DataF:TDateTime):Integer;


var
contador:Integer;
begin
if DataI > DataF then
begin
result := 0;
exit
end;
Contador := 0;
while (DataI <= DataF) do
begin
if ((DayOfWeek(DataI) <> 1) and (DayOfWeek(DataI) <> 7)) then
Inc(Contador);
DataI := DataI + 1

end;
result := Contador;
end;

Pular sabado e domingo


function TForm1.DiasUteis(DataI, DataF:TDateTime):TDateTime;
Var
contador:Integer;
Begin
If DataI > DataF Then Begin
result := 0;
exit
End;

Contador := 0;
While (DataI <= DataF) do Begin
If ((DayOfWeek(DataI) = 1) or (DayOfWeek(DataI) = 7)) then
//Inc(Contador);
DataF := DataF + 1;
DataI := DataI + 1;
End;

result := DataF;// + Contador;

Coverter string em data

function ConverteData(data:String):TDate;
Begin
If (data <>) '' and (Length(data)= 8)Then
Result:= StrToDate(copy(data, 7,2) + '/'+ copy(data, 5,2)+ '/' + copy(data,
1,4))
Else Result:= StrToDate(01/01/1899');
End;

//Delimitador

function Split(const Str: string; Delimiter : Char): TStringList;


var i:Integer;
sValor:String;
begin
sValor:= '';
for i:= 1 to length(Str) do begin
if Str[i] <> Delimiter then
sValor:= sValor + str[i]
else begin
tempo.Add(sValor);
sValor:= '';
end;
end;
tempo.Add(sValor);
end;

Somar horas

Function SomarHora(Hr1, Hr2:String):String;


Const
SEGUNDOS_POR_HORA : Integer = 360;
SEGUNDOS_POR_MINUTO : Integer = 60;
MINUTOS_POR_HORA : Integer = 60;
Var
Horas,Horas2,Minutos,Minutos2,Segundos,Segundos2,MiliSeg:Word ;
Resultado,Total1, Total2, i:Integer;
teste:TDateTime;
sResultado:String;

Begin

Horas:= 0;
Horas2:= 0;
Minutos:= 0;
Minutos2:=0;
Total1:= 0;
Total2:= 0;

if length(Hr1)> 0 then begin


Split(Hr1, ':');
Horas:= StrToInt(tempo.Strings[0]);
minutos:= StrToInt(tempo.Strings[1]);
Total1:= (horas * 60) + minutos ;
Tempo.Clear;
end;

if length(Hr2)> 0 then begin


Split(Hr2, ':');
Horas:= StrToInt(tempo.Strings[0]);
minutos:= StrToInt(tempo.Strings[1]);
DecodeTime(StrToTime(Hr2), horas2, minutos2, segundos2, MiliSeg);
Total2:= (horas2 * 60) + minutos2 ;
Tempo.Clear;
end;

resultado:= Total1 + Total2;

Horas := Resultado Div MINUTOS_POR_HORA;


Minutos := Resultado Mod MINUTOS_POR_HORA;
Segundos :=0;

sResultado:= FormatFloat('00',Horas) + ':' + formatFloat('00',Minutos);

if sResultado = '00:00' then


sResultado:= '';
Result := sResultado;
end;

//Fun��o para transformar minutos em horas


//Ex: 90 min = 1:30

Function MinparaHora(Minuto: integer): string;


var
hr, min : Integer;
begin
hr := 0;
while minuto >= 60 do begin
minuto := minuto - 60;
hr := hr + 1;
end;
min := minuto;
Result := FormatFloat('00:', hr) + FormatFloat('00', min);
end;

// Converter hora para minutos.


Function HoraParaMin(Hora: String): Integer;
begin
Result := (StrToInt(Copy(Hora,1,2))*60) + StrToInt(Copy(Hora,4,2));
end;

Abrir arquivo qualquer extens�o


If fileExists(caminho) then
ShellExecute(Handle, nil, Pchar(caminho), nil, nil, SW_SHOWNORMAL);

Renomear arquivo
Procedure TfrEstimativa.Renomear(original:String);
var
sAux, sCaminho: string;
begin
sCaminho:= ExtractFilePath(Application.ExeName)+ 'Estimativas\Pendentes';
If FileExists(sCaminho + original) then Begin
sAux:= Trim(AnsiReplaceStr(original,'FastReport_ ',''));
If FileExists(sCaminho +sAux)Then
DeleteFile(sCaminho +sAux);
If RenameFile(sCaminho +original, sCaminho +sAux) then
Log(date(),'Renomeado com sucesso','iTracker','ITK002')
Else
Log(date(),'Erro Renomear','iTracker','ITK002');
End;
End;

Function GetNetUserName: string;


Var
NetUserNameLength: DWord;
Begin
NetUserNameLength:=50;
SetLength(Result, NetUserNameLength);
GetUserName(pChar(Result),NetUserNameLength);
SetLength(Result, StrLen(pChar(Result)));
End;

Edit aceitar apenas n�meros

Na rotina abaixo, o TEdit s� aceitar� n�meros de 0 a 9 e o BackSpace (Chr(8)). Se


voc� quiser a v�rgula tamb�m, coloque dentro do colchete DecimalSeparator

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

begin

if not (Key in['0'..'9',Chr(8)]) then Key:= #0;

end;

Convertendo para mai�scula ao digitar em uma caixa de texto

No evento OnKeyPress do componente Edit1.:

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);

begin

if Key in ['a' .. 'z'] then

Key :=UpCase(Key);

end;

Cancelando a exibi��o de um formul�rio

Se a mensagem WM_CLOSE for enviada antes do formul�rio ser exibido, a sua exibi��o
ser� cancelada:

procedure TForm1.Form1OnShow (Sender : TObject);


begin
...
PostMessage (Handle, wm_Close, 0, 0);
end;

Validar datas

try

StrToDate(Edit1.Text);
except
on EConvertError do
ShowMessage ('Data Inv�lida!');
end;

// permite formatar o tamanho de um arquivo em bytes em


// Kb, Mb ou Gb
function TamanhoArquivoFormatado(const bytes: Longint): string;
const
b = 1; // byte
kb = 1024 * b; // kilobyte
mb = 1024 * kb; // megabyte
gb = 1024 * mb; // gigabyte
begin
if bytes > gb then
Result := FormatFloat('#.## GB', bytes / gb)
else if bytes > mb then
Result := FormatFloat('#.## MB', bytes / mb)
else if bytes > kb then
Result := FormatFloat('#.## KB', bytes / kb)
else
Result := FormatFloat('#.## bytes', bytes);
end;

// fun��o que permite obter o tamanho de um arquivo em bytes


function TamanhoArquivoBytes(arquivo: string): Int64;
var
search_rec: TSearchRec;
begin
if FindFirst(arquivo, faAnyFile, search_rec) = 0 then
Result := Int64(search_rec.FindData.nFileSizeHigh) shl Int64(32)
+ Int64(search_rec.FindData.nFileSizeLow)
else
Result := -1;

FindClose(search_rec);
end;

procedure TForm1.Button1Click(Sender: TObject);


var
arquivo: string;
begin
// nome do arquivo que queremos obter o tamanho
arquivo := 'C:\estudos_delphi\programa_vcl\arquivo.txt';

// exibe o resultado
ShowMessage('O tamanho do arquivo �: ' +
TamanhoArquivoFormatado(TamanhoArquivoBytes(arquivo)));
end;

[[csFch."Unitario"] + ([csFch."Ipi_Valor"]/[csFch."Quantidade"]) -
[csFch."ISS_Valor"]]

o c�digo para fazer longof �:


ExitWindows(EW_RebootSystem, 0)

o c�digo para desligar �:


WinExec('cmd /C shutdown -s -t 03', SW_SHOW);

ExitWindowsEx(EWX_SHUTDOWN + EWX_FORCE, 0);

{Desligar o Windows}
procedure TForm1.Button1Click(Sender: TObject);
begin
ExitWindowsEx(EWX_SHUTDOWN,0);
end;

{Efetuar novo Logon}


procedure TForm1.Button2Click(Sender: TObject);
begin
ExitWindowsEx(EWX_LOGOFF,0);
end;

{Rebootar}
procedure TForm1.Button3Click(Sender: TObject);
begin
ExitWindowsEx(EWX_REBOOT,0);
end;
///h� v�rias fun��es como por exemplo:

Para desligar, reiniciar, resetar ou dar logout no sistema,

use a fun��o ExitWindowsEx, como abaixo:

ExitWindowsEx (uFlags, 0);

onde uFlags � o tipo de reinicializa��o que vai ocorrer.

Valores de uFlags:

EWX_FORCE - For�a todos os processos a terminar.

Ao inv�s de aparecer a mensagem "A aplica��o n�o est� respondendo",

ele for�a o programa que n�o responde a finalizar.

EWX_LOGOFF - Faz "logout" do sistema, ou seja, volta � tela de login

(a que pede nome e senha)

EWX_POWEROFF - Desliga o computador

(caso o computador n�o tenha o recurso de auto-desligamento,

ele fecha todos os programas e informa que o sistema pode ser desligado).
EWX_REBOOT - Reinicializa o computador

(o equivalente a pressionar Ctrl+Alt+Del)

EWX_SHUTDOWN - Fecha todos os programas e informa

ao usu�rio que � seguro desligar o computador.

function GetEnvVarValue(const VarName: string): string;


var
BufSize: Integer; // buffer size required for value
begin
// Get required buffer size (inc. terminal #0)
BufSize := GetEnvironmentVariable(PChar(VarName), nil, 0);
if BufSize > 0 then
begin
// Read env var value into result string
SetLength(Result, BufSize - 1);
GetEnvironmentVariable(PChar(VarName),
PChar(Result), BufSize);
end
else
// No such environment variable
Result := '';
end;

//Exemplo de uso:
with Memo1.Lines.Add do
begin
Add(GetEnvVarValue('ALLUSERSPROFILE'));
Add(GetEnvVarValue('APPDATA'));
Add(GetEnvVarValue('CLIENTNAME'));
Add(GetEnvVarValue('CommonProgramFiles'));
Add(GetEnvVarValue('COMPUTERNAME'));
Add(GetEnvVarValue('ComSpec'));
Add(GetEnvVarValue('HOMEDRIVE'));
Add(GetEnvVarValue('HOMEPATH'));
Add(GetEnvVarValue('LOGONSERVER'));
Add(GetEnvVarValue('NUMBER_OF_PROCESSORS'));
Add(GetEnvVarValue('OS'));
Add(GetEnvVarValue('Path'));
Add(GetEnvVarValue('PATHEXT'));
Add(GetEnvVarValue('PCToolsDir'));
Add(GetEnvVarValue('PROCESSOR_ARCHITECTURE'));
Add(GetEnvVarValue('PROCESSOR_IDENTIFIER'));
Add(GetEnvVarValue('PROCESSOR_LEVEL'));
Add(GetEnvVarValue('PROCESSOR_REVISION'));
Add(GetEnvVarValue('ProgramFiles'));
Add(GetEnvVarValue('SESSIONNAME'));
Add(GetEnvVarValue('SystemDrive'));
Add(GetEnvVarValue('SystemRoot'));
Add(GetEnvVarValue('TEMP'));
Add(GetEnvVarValue('TMP'));
Add(GetEnvVarValue('USERDOMAIN'));
Add(GetEnvVarValue('USERNAME'));
Add(GetEnvVarValue('USERPROFILE'));
Add(GetEnvVarValue('windir'));
end;

Copiar arquivos
Procedure FileCopy( Const sourcefilename, targetfilename: String );
Var
S, T: TFileStream;
Begin
S := TFileStream.Create( sourcefilename, fmOpenRead );
try
T := TFileStream.Create( targetfilename, fmOpenWrite or fmCreate );
try
T.CopyFrom(S, S.Size ) ;
finally
T.Free;
end;
finally
S.Free;
end;
End;

// No 2:{ Este modo usa bloco de leitura/escrita}

procedure FileCopy(const FromFile, ToFile: string);


var
FromF, ToF: file;
NumRead, NumWritten: Word;
Buf: array[1..2048] of Char;
begin
AssignFile(FromF, FromFile);
Reset(FromF, 1); { Record size = 1 }
AssignFile(ToF, ToFile); { Open output file }
Rewrite(ToF, 1); { Record size = 1 }
repeat
BlockRead(FromF, Buf, SizeOf(Buf), NumRead);
BlockWrite(ToF, Buf, NumRead, NumWritten);
until (NumRead = 0) or (NumWritten <> NumRead);
System.CloseFile(FromF);

System.CloseFile(ToF);
end;

Function RemoveAcentos(Str:String): String;


{Remove caracteres acentuados de uma string}
Const ComAcento = '����������������������������';
SemAcento = 'aaeouaoaeioucuAAEOUAOAEIOUCU';
Var
x : Integer;
Begin
For x := 1 to Length(Str) do
Begin
if Pos(Str[x],ComAcento)<>0 Then
begin
Str[x] := SemAcento[Pos(Str[x],ComAcento)];
end;
end;
Result := Str;
end;

Copiar string at� determinado caracter; ex.: "espa�o"


var
iPos: Integer;
begin
iPos := Pos(' ', s);
if iPos > 0 then
ShowMessage('Primeira Palavra: ' + Copy(s, 1, iPos));
end;

� Obtendo o tipo de sistema operacional

C�digo:
function PegarOs: String;
var
PlatformId, VersionNumber: string;
CSDVersion: String;
begin
CSDVersion := '';

// Detecta Plataforma
case Win32Platform of
// Teste para familia do windows 95,9X
VER_PLATFORM_WIN32_WINDOWS:
begin
if Win32MajorVersion = 4 then
case Win32MinorVersion of
0: if (Length(Win32CSDVersion) > 0) and
(Win32CSDVersion[1] in ['B', 'C']) then
PlatformId := '95 OSR2'
else
PlatformId := '95';
10: if (Length(Win32CSDVersion) > 0) and
(Win32CSDVersion[1] = 'A') then
PlatformId := '98 SE'
else
PlatformId := '98';
90: PlatformId := 'ME';
end
else
PlatformId := '9x version (unknown)';
end;
//Teste para familia NT
VER_PLATFORM_WIN32_NT:
begin
if Length(Win32CSDVersion) > 0 then CSDVersion := Win32CSDVersion;
if Win32MajorVersion <= 4 then
PlatformId := 'NT'
else
if Win32MajorVersion = 5 then
case Win32MinorVersion of
0: PlatformId := '2000';
1: PlatformId := 'XP';
2: PlatformId := 'Server 2003';
end
else if (Win32MajorVersion = 6) and (Win32MinorVersion = 0) then
PlatformId := 'Vista'
else
PlatformId := 'Windows 7';
end;
end;
Result :=PlatformId;
end;
Autor: TGA

� Verificando se o usuario possui privilegios administrativos


C�digo:
function AdminPriv: Boolean;
const
AUTORIDADE_NT_SYSTEM: TSIDIdentifierAuthority = (Value: (0, 0, 0, 0, 0, 5));
SECURITY_BUILTIN_DOMAIN_RID = $00000020;
DOMAIN_ALIAS_RID_ADMINS = $00000220;
var
x: Integer;
hMascara_acesso: THandle;
conseguiu: BOOL;
dwInfoBufferSize: DWORD;
AdminPSID: PSID;
gruposp: PTokenGroups;
begin
Result := False;
conseguiu := OpenThreadToken(GetCurrentThread, TOKEN_QUERY, True,hMascara_acesso);
if not conseguiu then
begin
if GetLastError = ERROR_NO_TOKEN then
conseguiu := OpenProcessToken(GetCurrentProcess, TOKEN_QUERY,hMascara_acesso);
end;
if conseguiu then
begin
GetMem(gruposp, 1024);
conseguiu := GetTokenInformation(hMascara_acesso, TokenGroups,gruposp, 1024,
dwInfoBufferSize);
CloseHandle(hMascara_acesso);
if conseguiu then
begin
AllocateAndInitializeSid(AUTORIDADE_NT_SYSTEM, 2,SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, AdminPSID);
{$R-}
for x := 0 to gruposp.GroupCount - 1 do
if EqualSid(AdminPSID, gruposp.Groups[x].Sid) then
begin
Result := True;
Break;
end;
{$R+}
FreeSid(AdminPSID);
end;
FreeMem(gruposp);
end;
end;
Autor: TGA/Con�T4nT1nO

� Obtendo Nome do usuario Logado


C�digo:
function NomeUsuario: String;
var
Usuario: Pchar;
Tamanho: Cardinal;
begin
Result := '';
Tamanho := 100;
Getmem(usuario, Tamanho);
GetUserName(Usuario, Tamanho);
Result := Usuario;
FreeMem(usuario);
end;
Autor: TGA

� Obtendo Nome do Computador


C�digo:
function Nomepc: String;
var
PC: Pchar;
Tamanho: Cardinal;
begin
Result := '';
Tamanho := 100;
Getmem(PC, Tamanho);
GetComputerName(PC, Tamanho);
Result := PC;
FreeMem(PC);
end;
Autor: TGA

� Obtendo Serial do Disco


C�digo:
Function SerialDisco(Disco: String): String;
Var
Serial:DWord;
DirLen,Flags: DWord;
DLabel : Array[0..11] of Char;
begin
Result := '';
GetVolumeInformation(PChar(disco),dLabel,12,@Serial,DirLen,Flags,nil,0);
Result := IntToHex(Serial,8);
end;
Autor: TGA

� Obtendo MacAddress
C�digo:
Function MacAddress: string;
var
ID1, ID2: TGUID;
apiFunc:Function(GUID: PGUID): Longint; stdcall;
dll:cardinal;
begin
Result := '';
dll := LoadLibrary('rpcrt4.dll');
if dll <> 0 then
begin
@apiFunc := GetProcAddress(dll, 'UuidCreateSequential');
if Assigned(apiFunc) then
begin
if (apiFunc(@ID1) = 0) and
(apiFunc(@ID2) = 0) and
(ID1.D4[2] = ID2.D4[2]) and
(ID1.D4[3] = ID2.D4[3]) and
(ID1.D4[4] = ID2.D4[4]) and
(ID1.D4[5] = ID2.D4[5]) and
(ID1.D4[6] = ID2.D4[6]) and
(ID1.D4[7] = ID2.D4[7]) then
begin
Result :=
IntToHex(ID1.D4[2], 2) + '-' +
IntToHex(ID1.D4[3], 2) + '-' +
IntToHex(ID1.D4[4], 2) + '-' +
IntToHex(ID1.D4[5], 2) + '-' +
IntToHex(ID1.D4[6], 2) + '-' +
IntToHex(ID1.D4[7], 2);
end;
end;
end;
end;
Autor:TGA/DarkLordn

� Obtendo Resolucao

C�digo:
Function Resolucao() : String;
var W,h:String;
begin
w := INtTOStr(screen.Width);
h := IntToStr(screen.Height);
Result := w+' x '+h;
end;
Autor:TGA

Você também pode gostar