Jump to content

Recommended Posts

Posted

OK thanks for trying! :D

Anybody else got any idea's? I'll have a look elsewhere aswell, If I find an answer I'll post back here.


Posted

BINGO :thumbup:thumbup:thumbup

unit Unit1;

interface

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls;

type

  TForm1 = class(TForm)

    Label1: TLabel;

    Label2: TLabel;

    Button1: TButton;

    procedure Button1Click(Sender: TObject);

    function GetComputerName1:string;

  private

    { Private declarations }

  public

    { Public declarations }

  end;

var

  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);

begin

ShowMessage (GetComputerName1);

end;

function TForm1.GetComputerName1:string;

var

buffer: array[0..255]of char;

Size: dword;  :w00t:

begin

Size := MAX_COMPUTERNAME_LENGTH + 1;

GetComputerName(buffer,size);

Result := StrPas(buffer);

end;

end.

Thanks again for the help.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...