Results 1 to 4 of 4

Thread: How to register file type with windows

  1. #1

    Thread Starter
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    How to register file type with windows

    Hello all,
    My application creates a file using a proprietary format... Let's say something like "myFile.stan". My question is, how do I register this filetype (.stan) with windows so that when someone double-click on the file, windows will open it with my application? This application will be distributed as standalone exe file (no installation). I've seen some applications that do the same thing. The users just have to copy the exe file to some directory in their local harddrive and run it once. It then will register in windows. After that, the users can double-click on any of its files and the program will launch and open that file.
    Thanks for any guidance/inputs.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: How to register file type with windows

    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: How to register file type with windows

    You just need to do that pragmatically. Take a look at the Registry Class
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  4. #4
    New Member
    Join Date
    Aug 2007
    Posts
    4

    Re: How to register file type with windows

    it is done via the registry. In HKCR put 2 keys. 1 named .stan and other named stanfile. In the .stan in the (predefined) put "stanfile"(no quotes) and in stanfile create a folder named "DefaultIcon", other "Shell", in stanfile , in (predefinied) put the icon's path, in Shell create a key named "Open", in Open create a key named "Command" and in the (Predefinied) of command put (root of your app)\(yourapp).exe "%1" (including quotes). and it's done. It will work automatically, but the icons are set when windows restarts.

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