1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

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 AdminDF, Nov 5, 2014.

  1. AdminDF
    Online

    AdminDFAdminDF is a Verified Member Delphifan 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
    Online

    bodyalev Guest

    RE:

    sometimes its really usefull for sure
     
  6. Wisker
    Offline

    Wisker DF Junior

    This could come in handy.
     
  7. ROBSMI
    Online

    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