Dismiss Notice

REGISTRATION IS AFTER ADMIN ACTIVATION

DONATIONS WITH PAYPAL CLICK TO BUTTON

3 MONTHS VIP - 10$; 6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$

DONATIONS WITH Bitcoin Address:3NRs3CK3fhXifrNYxHEZKpETDd9vNLMsMD

Dismiss Notice
The registration is approved by the Administrator. It takes about 1 day to approve your registration
Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Usefull Code In Delphi

Discussion in 'Delphi Programming' started by N0body, Nov 5, 2014.

  1. N0body
    Online

    N0bodyN0body is a Verified Member DelphiFan Administrator Staff Member DF Staff

    Get Hwid :


    Code:
    function getHWID(): String;
    var
    SerialNum,A,B: DWord;
    C: array [0..255] of Char;
    Buffer: array [0..255] of Char;
    begin
    if GetVolumeInformation(pChar('C:\'), Buffer, 256, @SerialNum, A, B, C, 256) then
      Result := inttostr(SerialNum * Cardinal(-1))
    else Result := '';
    end; 
    

    Know which language the computer uses:


    Code:
    function MyLanuge: string;
    Var
      IsValidCountryCode  :Boolean;
      CountryCode         :Array[0..4] of Char;
      Begin
      IsValidCountryCode := (3 = GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_SISO3166CTRYNAME,CountryCode,SizeOf(CountryCode)));
        if IsValidCountryCode then
        Begin
      result := PChar(@CountryCode[0]);
      end;
      end; 
    
     
    Have The PC Name : 


    Code:
    uses
     Registry;
     
    var
    Reg: TRegistry;
    Name: array[0..255] of char;
    ComputerName: string;
    size: dword;
     
     
    begin
    size := 255;
     
    if GetComputerName(Name, size) then
    edit2.text := Name else
    edit2.text := 'Introuvable';
    reg := TRegistry.Create;
    reg.RootKey := HKEY_LOCAL_MACHINE;
         edit4.Text := edit1.Text +'|'+ edit2.Text +'|'+ edit3.Text;
    end; 
    
     
    Have The Open Session User Name :


    Code:
    function GetCurrentUserName: string;
    const
      cnMaxUserNameLen = 254;
    var
      sUserName: string;
      dwUserNameLen: DWORD;
    begin
      dwUserNameLen := cnMaxUserNameLen - 1;
      SetLength(sUserName, cnMaxUserNameLen);
      GetUserName(PChar(sUserName), dwUserNameLen);
      SetLength(sUserName, dwUserNameLen);
      Result := sUserName;
    end; 
    Get Total PC RAM :
    
    function GetTotalRAM(): String;
    var
      MemoryStatus: TMemoryStatus;
    begin
      MemoryStatus.dwLength := SizeOf(TMemoryStatus);
      GlobalMemoryStatus(MemoryStatus);
      Result := IntToStr(MemoryStatus.dwTotalPhys div 1048576) + 'MB';
    end; 
     
    
     
  2. a_marwan
    Offline

    a_marwan DF Member

    RE:

    Thanks
     
  3. chimotoki
    Offline

    chimotoki DF Junior

    RE:

    Thank you
     
  4. rendou
    Offline

    rendou DF Member

    RE:

    thanks
     
  5. bodyalev
    Offline

    bodyalev Guest

    RE:

    sometimes its really usefull for sure
     
  6. Wisker
    Offline

    Wisker DF Junior

    This could come in handy.
     
  7. ROBSMI
    Offline

    ROBSMI Guest

    RE:

    very good tips, thank you very much ;)
     
  8. mario.joker
    Offline

    mario.joker DF Junior

  9. fabalo76
    Offline

    fabalo76 DF Member

    thank you for your effort.
     

Share This Page

Laws
Our website, law, laws, copyright and aims to be respectful of individual rights. Our site, as defined in the law of 5651 serves as a provider of space. According to the law, contrary to the law of site management has no obligation to monitor content. Therefore, our site has adopted the principle of fit and remove. Works are subject to copyright laws and is shared in a manner that violated their legal rights, or professional associations, rights holders who, adsdelphi@gmail.com I can reach us at e-mail address. Complaints considered to be infringing on the examination of the content will be removed from our site.
Donate Help To Us and Be VIP
DONATIONS WITH PAYPAL CLICK TO BUTTON
6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$
Social Block