Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 A question

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
Walrus Posted - Oct 28 2005 : 1:46:09 PM
First of all, I have to confess that I haven't really searched for the answer extensively, so if the solution is already available somewhere, let alone on this forum, or if it happens to be very obvious, I apologize.

That said, here the thing: say you make a program that uses its own file format, like savegames for a game or sth. Then, you'd like to make your program the default program for opening this kind of files. Now, the user could do this sort of thing on his/her own, of course, but you'd like to automate it, during installation or the first time the program is executed, like many programs do. How would you go about doing that in VB(6.0)?

Any help greatly appreciated.
5   L A T E S T    R E P L I E S    (Newest First)
Walrus Posted - Nov 13 2005 : 09:51:44 AM
Great! I may have some more questions once I look into this a bit more, but for now - thank you very much!
cbx Posted - Nov 11 2005 : 05:27:19 AM
VB6 has the GetSetting and SetSetting but they only provide restricted access to the registry You will need to use the win32 api calls or use managed .net code to access the complete registry including the parts that are involved in file type association.

To associate a file extention with your app falolow these steps


  • Click "Start" then "Run" and run "regedit"

  • Right click "HKEY_CLASSES_ROOT" and create a "new->key" with your file extention If your file extention is "testext" then name the key ".testext" making sure to include the period before the extention

  • With your new key selected in the left side tree Right click the "(Default)" item in the right pane and select "Modify"

  • Give the "(Default)" item a unuiqe key something similar to your apps name like "testextapp"

  • Right click "HKEY_CLASSES_ROOT" again and create a "new->key" with the name you specified in the previous step for example "testextapp"

  • Right click the "testextapp" key and add a "New->Key" and call it "Shell"

  • Right click the "Shell" key and add a "New->Key" and call it "Open"

  • Right click the "Open" key and add a "New->Key" and call it "Command"

  • With the "Command" key selected right click the "(Default)" item in the right pane and select "Modify"

  • type the full path to your app and include a %1 at the end. For example "c:\windows\notepad.exe %1"



Now all files ending in ".textext" will be associated with notepad. Double clicking a .textext file will run notepad and notepad will open the file.
Walrus Posted - Nov 10 2005 : 5:34:11 PM
Thanks! I'll look into it. Hopefully, I can figure it out now that I know roughly what to look for. :)
rychan Posted - Nov 10 2005 : 09:55:21 AM
Aren't there Get and SetRegistry functions available in vb6? I'm sure i saw them a while ago.
TwistedMatrix Posted - Nov 09 2005 : 12:25:49 PM
Its a registry thing. You need to create a new registry entry for the extention type. Sorry, dont have a code example. If you figure it out let me know.

VBGamer © Go To Top Of Page
This page was generated in 0.09 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.