Link to home
Start Free TrialLog in
Avatar of penfold69
penfold69

asked on

username

how can i get my icq username with delphi code?

please help

can post more points if necessary
Avatar of alanwhincup
alanwhincup

You could do it like this: Unsure if it works with all versions of ICQ though:

Just drop a TButton and TMemo on a form and then add the below code to the TButton's OnClick event. Also don't forget to add 'Registry' to the uses clause of the unit.

procedure TForm1.Button1Click(Sender: TObject);
var
  Reg : TRegistry;
  UINS : TStringList;
  I : Integer;
begin
  Memo1.Clear;
  UINS := TStringList.Create;
  Reg := TRegistry.Create;
  with Reg do
  begin
    try
      RootKey := HKEY_LOCAL_MACHINE;
      OpenKey('Software\Mirabilis\ICQ\Owners', False);
      GetKeyNames(UINS);
      for I := 0 to UINS.Count - 1 do
      begin
        CloseKey;
        OpenKey('Software\Mirabilis\ICQ\Owners\' + UINS[I], False);
        Memo1.Lines.Add(UINS[I] + ': ' + ReadString('Name'));
      end;
      CloseKey;
    finally
      Free;
    end;
  end;
end;

Cheers,

Alan
Also another way you could do this is with the use of ICQ's API for developers: http://www.icq.com/api/
Avatar of penfold69

ASKER

does not work?

do u have any other code that can get details from ICQ ie

users on my contact list etc?

 
ASKER CERTIFIED SOLUTION
Avatar of alanwhincup
alanwhincup

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial