Re: detecting when the registry is locked (e.g. limited users with WindowsXP)

From: Brian Cook (bcook_at_rowdydogsoftware[REMOVE)
Date: 12/05/03


Date: Fri, 5 Dec 2003 12:43:46 -0600


> Hello-

Greetings.

> Since my software is
> used in university student labs where all the computers are restricted, is
> there a way that my software can automatically detect if the current user
> is an adminstrator or not?

You shouldn't have to. Try this...

> procedure registerfiletype(inft,inkey,desc,icon:string);
> var myreg : treginifile;
> ct : integer;
> ft,key: string;
> begin

    try

> ft := inft;
> key := inkey;
> ct := pos('.',ft);
> while ct > 0 do begin
> delete(ft,ct,1);
> ct := pos('.',ft);
> end;
> if (ft = '') or (Application.ExeName = '') then exit; //not a valid
> file-ext or ass. app
> ft := '.'+ft;
> myreg := treginifile.create('');
> try
> myreg.rootkey := hkey_classes_root; // where all file-types are
> described
> if key = '' then key := copy(ft,2,maxint)+'_auto_file'; // if no
> key-name is given, create one
> myreg.writestring(ft,'',key); // set a pointer to the
> description-key
> myreg.writestring(key,'',desc); // write the description
> myreg.writestring(key+'\DefaultIcon','',icon); // write the
> def-icon if given
> //showmessage(key);
> myreg.writestring(key+'\shell\open\command','',Application.ExeName+'
> %1'); //association
> finally
> myreg.free;
> end;

    except
    end;

> end;

Good luck, Brian



Relevant Pages

  • Re: Security bulletin MS03-013
    ... Some computers have issues with 811493 causing a slowdown, ... antivirus applications. ... "Brian" wrote in message ...
    (microsoft.public.windowsxp.security_admin)
  • Re: OT: Chemo first round completed
    ... I also think you make your own luck to a certain degree. ... computers using assorted components from previous computers about five ... It's all about priorities and attitude, ... She looked so scared when she got out of her car - ...
    (alt.support.diabetes)
  • Re: MS What Is going on with networking?
    ... >> OK, Brian, ... >>>Browser stat for C to folllow. ... Looking at aggregated browstat and ipconfig logs for all 3 computers. ... # All 3 computers acknowledge same master and backup browser, Dadsnew. ...
    (microsoft.public.windowsxp.network_web)
  • Re: trouble networking - access denied
    ... noted and no luck. ... > Windows XP Professional File Sharing: ... >> I have four computers on a network using xp. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Windows XP Professional
    ... three other computers and ALWAYS, ... Brian A. Sesko ... website except one. ... tried Firefox and Netscape with the same results. ...
    (microsoft.public.windowsxp.hardware)