Read Registry for Default Image Editor

// Hello,

// I need some code for reading the registry for the defualt image editor

procedure ThankYou(TOject: Sender);

// :)
LVL 3
fibdevAsked:
Who is Participating?
 
King_DavidCommented:
function CheckAssociatedFileType(FileType: AnsiString): String;
// Example: ShowMessage(CheckAssociatedFileType('.bmp'));
var
  Reg: TRegistry;
  Str: String;
begin
  Reg := TRegistry.Create;
  Result := '';
  with Reg do
    begin
    RootKey := HKEY_CLASSES_ROOT;
    if not OpenKey('\'+FileType, False) then Exit;
    Str := ReadString(''); // '' reads the default.
    if not OpenKey('\'+Str+'\Shell\Open\command', False) then Exit;
    Result := ReadString(''); // '' reads the default.
    end;
  Reg.Free;
end;
0
 
fibdevAuthor Commented:
How do I take the variable off the end of the string?

example:

c:\WINNT\paint.exe %1
0
 
King_DavidCommented:
If it includes spaces than " is your delimiter
else
the space is your delimiter.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
fibdevAuthor Commented:
Please explain?
0
 
fibdevAuthor Commented:
Question wasn't answered completely, no activity for at least 2 weeks.

Sorry
0
 
fibdevAuthor Commented:
This question has a deletion request Pending
0
 
King_DavidCommented:
This question no longer is pending deletion
0
 
King_DavidCommented:
You asked for some code for reading the registry for the defualt image editor - I gave you.
For 25 points I can not do more than you first asked!

Regards, David.

0
 
fibdevAuthor Commented:
I'm not going to bicker over 25 points, but my problem wasn't solved, I ended up solving it myself.
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.