CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2000
    Location
    Dublin, Ireland
    Posts
    21

    Registering File Types

    Hi, my program creates a number of files that I would like to register as a known file type with the windows OS. Rather than manually doing this (ie via the explorer window) I would like to be able to do this in software, say when the user first runs the program. These files have the suffix ".ntm"

    Then, once registered, when the user double clicks one of the ".ntm" files my application opens and I display the contents of that file somewhere on one of the forms.

    There are 2 issues here and help with either (or both preferably!) will be gratefully received,

    Can anyone help?

    Thanks in advance

    Sean Newell


  2. #2
    Join Date
    Apr 1999
    Location
    Rotterdam, Netherlands
    Posts
    278

    Re: Registering File Types

    Not a ready-to-go answer, but I'm sure you can work it out... :-)
    Check out the registry, HKEY_CLASSES_ROOT, and take a file that is registered as example. bmp is easy (I used .frm when I needed it). See what the values say, first you find the .extension key, if you open it, you see a description... A little lower there's a key with that description, and see what the values are, and check in your windooz explorer what it says with the selected filetype... it's harder to explain then to see it for yourself... it's really so easy.
    To modify it, go to the main codeguru/vb section, and I think in ActiveX you can download a regstry class for easy registry access....
    Once you fixed it all, you need to read out Command$ in your program, which contains the commandline (the file), open that and do with it what you want....
    hth

    Crazy D :-)
    "One ring rules them all"

  3. #3

    Re: Registering File Types


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured