Re: detecting when the registry is locked (e.g. limited users with WindowsXP)
From: Brian Cook (bcook_at_rowdydogsoftware[REMOVE)
Date: 12/05/03
- Next message: Daaron: "Re: Hidden Forms"
- Previous message: Parmod: "Hidden Forms"
- In reply to: chris_at_mricro.com: "detecting when the registry is locked (e.g. limited users with WindowsXP)"
- Next in thread: Ray Marron: "Re: detecting when the registry is locked (e.g. limited users with WindowsXP)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Daaron: "Re: Hidden Forms"
- Previous message: Parmod: "Hidden Forms"
- In reply to: chris_at_mricro.com: "detecting when the registry is locked (e.g. limited users with WindowsXP)"
- Next in thread: Ray Marron: "Re: detecting when the registry is locked (e.g. limited users with WindowsXP)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|