urgent help on api

how to call api in delphi

please help asap

rajni
rajniyadavAsked:
Who is Participating?
 
Stuart_JohnsonConnect With a Mentor Commented:
Hi Barry :)

rajni: You can use the registry go get the product ID for Windows.  Look in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion.  The key string you are looking for is ProductID

If you don't know how to use the registry, try this:

function GetProductID: string;
begin
  Result := ''; {the default result if value not found}
  with TRegistry.Create do
    try
      RootKey := HKEY_LOCAL_MACHINE;
      if OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion', false) then
        if ValueExits('ProductID') then
          Result := ReadString('ProductID');
      CloseKey;
    finally
      free;
    end; {try..finally}
end; {GetProductID}

Is this what you are trying to achieve?  If not, please give more details.

Regards.

Stuart.
0
 
intheCommented:
what api?
there are millions..

alot are defined already in the .pas/.dcu files in your delphi dir.

some are not for instance:
if you add shellapi to the uses section  you can call:
shellexecute(handle,'open',pchar('somefile'),nil,nil,sw_normal);
0
 
rajniyadavAuthor Commented:
inthe

i want to call window's api

do u know how to do that in delphi
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
rajniyadavAuthor Commented:
i want to know the product id or some unique number
to identify a machine do you any other way of doing this.

0
 
intheCommented:
>>i want to call window's api
>>do u know how to do that in delphi

you have to be new to delphi so im wondering did you get any book with your delphi version?
i think you need to read one on delphi or browse the help files a bit...

here is some very good sites to get you started:
http://delphi.about.com/cs/beginners/
http://www.delphi3000.com/
http://www.torry.net/

they do have answers to your particular problem but you should understand what your doing before doing it ..
 
running before walking can be dangerous ;-)
0
 
ComTechCommented:
rajniyadav, is this by any chance this is a homework assignment?

Please answer my question.

Thank you,
Community Support Moderator
0
 
Tech_EdCommented:
rajniyadav,

You appear to have two accounts here at Experts Exchange, although the site rules and guidelines permit you to have only one account. Please advise which account you wish to keep open and I will close the other.

Tech_Ed
Community Support Administrator
0
 
rajniyadavAuthor Commented:
this is not my home assissment
and i have only one account
0
 
Stuart_JohnsonCommented:
rajniyadav,

Are you going to tell us if any of the suggestions have helped at all?
0
 
Stuart_JohnsonCommented:
I take it this question was autograded as there have been no comments posted for this question for months.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.