Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

Read Registry for Default Image Editor

// Hello,

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

procedure ThankYou(TOject: Sender);

// :)
0
fibdev
Asked:
fibdev
  • 5
  • 4
1 Solution
 
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now