Solved

Read Registry for Default Image Editor

Posted on 2000-04-29
9
171 Views
Last Modified: 2011-09-20
// Hello,

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

procedure ThankYou(TOject: Sender);

// :)
0
Comment
Question by:fibdev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 1

Accepted Solution

by:
King_David earned 25 total points
ID: 2763493
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
 
LVL 3

Author Comment

by:fibdev
ID: 2763713
How do I take the variable off the end of the string?

example:

c:\WINNT\paint.exe %1
0
 
LVL 1

Expert Comment

by:King_David
ID: 2763879
If it includes spaces than " is your delimiter
else
the space is your delimiter.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:fibdev
ID: 2763885
Please explain?
0
 
LVL 3

Author Comment

by:fibdev
ID: 2815334
Question wasn't answered completely, no activity for at least 2 weeks.

Sorry
0
 
LVL 3

Author Comment

by:fibdev
ID: 2815335
This question has a deletion request Pending
0
 
LVL 1

Expert Comment

by:King_David
ID: 2816064
This question no longer is pending deletion
0
 
LVL 1

Expert Comment

by:King_David
ID: 2816065
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
 
LVL 3

Author Comment

by:fibdev
ID: 2816588
I'm not going to bicker over 25 points, but my problem wasn't solved, I ended up solving it myself.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi Mdi application Child forms get behind control 7 359
drawing animated level bar based on numbers 3 121
creating threads in delphi 1 201
enhance the following code 3 53
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question