title: Looking for Delphi 7 code to detect if a program is started with administrator rights?
body: <p>I am looking for <strong>working</strong> (<em>obviously</em>) <strong>Delphi 7 code</strong> so I can check whether <strong>my program is started with administrator rights</strong>.</p>
  
  <p>Thanks in advance</p>
  
  <p><strong>[--- IMPORTANT UPDATE ---]</strong></p>
  
  <p>Having reviewed the code in the answers so far, I realise that my question maybe is not so clear, or at least is not complete: </p>
  
  <ul>
  <li><p>I want to know <strong>whether my Delphi 7 program is started with the 'Run as admin' check box set</strong>. </p></li>
  <li><p><em>In other words:</em> I want to know whether it is possible for my <strong>Delphi 7 program to create/update files in the c:\Program Files... folders</strong>.</p></li>
  </ul>
  
  <p>Just checking if you have administrator rights is not enough for this.</p>