Solved

Read Registry for Default Image Editor

Posted on 2000-04-29
9
168 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
  • 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

816 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now