Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: August 13, 2025, 7:10 am

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coder needed.
#7
RE: Coder needed.
Whoa, Who'd have thought it would be this simple? Computer

Code:
procedure TForm1.RegisterFileType(ExtName:String);
var
  a: byte;

begin
  a:=0;

  with TRegistry.Create do
  try
    RootKey := HKEY_CLASSES_ROOT;

    DeleteKey('\.avi\');

    if OpenKey('\.avi\', True) then begin
      WriteString('','avifile');
      WriteString('PerceivedType', 'video');
      WriteString('Content Type', 'video/avi');
    end;

    OpenKey('\.avi\OpenWithList\ehshell.exe\', True);

    if OpenKey('\.avi\OpenWithProgIds\', True) then
      WriteBinaryData('avifile', a, 1);

   if OpenKey('\avifile\shell\open\command\', True) then
      WriteString('', '"'+ParamStr(0)+'" "%1"');

    RootKey := HKEY_CURRENT_USER;

    DeleteKey('\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.avi\');

    if OpenKey('\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.avi\OpenWithProgids\', True) then
      WriteBinaryData('avifile', a, 1);

  finally
    Free;
  end;

  SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
end;
[Image: cinjin_banner_border.jpg]
Reply



Messages In This Thread
Coder needed. - by Darwinian - April 7, 2012 at 7:49 pm
RE: Coder needed. - by Autumnlicious - April 8, 2012 at 3:16 pm
RE: Coder needed. - by Darwinian - April 8, 2012 at 6:01 pm
RE: Coder needed. - by Autumnlicious - April 8, 2012 at 11:51 pm
RE: Coder needed. - by Darwinian - April 9, 2012 at 12:23 am
RE: Coder needed. - by Autumnlicious - April 9, 2012 at 1:24 am
RE: Coder needed. - by Darwinian - April 9, 2012 at 8:48 am
RE: Coder needed. - by Autumnlicious - April 9, 2012 at 4:13 pm

Possibly Related Threads...
Thread Author Replies Views Last Post
  Urgent help needed emjay 24 3820 February 23, 2023 at 5:25 pm
Last Post: zebo-the-fat
  Networking Guru Needed popeyespappy 5 1073 October 9, 2021 at 2:53 pm
Last Post: Jehanne
  Tips for c++ [needed] SavageNerdz 21 8640 April 16, 2012 at 7:29 am
Last Post: Tiberius



Users browsing this thread: 1 Guest(s)