The simplest way is ofcourse to go to "My Computer" go to the Extra
menu, and go to Folder Options. There you have a tab "FileTypes". It
should be pretty straightfoward to add something here. :)
BUT, I guess you want this to happen automatically I guess: Then you
probably need registry access and add some keys and strings, binary
values, etc :) Lots of features but a bit complicated for the
everyday-user. And allthough this might appear very complicated and
non-structured it's not when you get used to working with the registry.
So so so so much options :).
Hmmm I don't know how to program Registry access in RB, but you could
make a .reg file. when you run it, the registry will be update for you.
I'll give you a quick tour about filetypes.
1) first create a folder like this:
\HKEY_CLASSES_ROOT\.extention\
.extention is ofcourse the extention of your filetype.
2) inside it put a String
Name : "Content Type"
Type : "REG_SZ"
Data : "appliction/x-myapplicationtypedescription"
3) Inside the .extention folder to put a new folder "ShellNew" ==> this
is to add your filetype to the NewFile panel when clicked with the right
mousebutton somewhere on the desktop! ;-)
4) inside this ShellNew menu you should add a String:
Name: "filename"
Type: "REG_SZ"
Data: "templatefile.extention"
5) That templatefile should exist at the following path:
%windir%\shellnew\templatefile.extension
(where %windir% is your windows directory ofcourse)
6)HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
In here you should add a folder ".extention" again.
Inside it make 2 new folders:
OpenWithList and OpenWithProgids
7) Inside the OpenWithList add as many strings as you like. Each string
is a application that will be added in the "Open With ..." that will
show up when you right click on the filetype. It is important to give
them names like this:
Name: a Type: REG_SZ Data: pathtoexe.exe
Name: b Type: REG_SZ Data: pathtoexe2.exe
Name: c Type: REG_SZ Data: pathtoexe3.exe
don't forget the following:
MRUList of Type REG_SZ with as datavalue:
"bac" These are all the codes mentioned earlier. I assume the order you
take will also change the order they appear in the menu(?)
In the OpenWithProgids folder add the following binary value:
Name: filetypekeyword Type: REG_NONE And No Data
8) Time for step 8 ;-) It's really simple isn't it :-D
Next you need to add this folder:
HKEY_CLASSES_ROOT\filetypekeyword
Ofcourse the filetypekeyword is the same one you used earlier !
Inside it create folders "DefaultIcon" and "shell"
Notice that when you create a folder there always is a "(default)"
String added. Normally you can just leave it there. But here it's
different. Inside the DefaultIcon folder you should change it's value to
the path of the icon you wish to use. Or you can also use the path of an
exe file I think followed by a "," and the iconnumber I think. Something
to experiment with if you are not crazy yet :)
9) Inside the filetypekeyword\shell folder you should now add a "open"
folder.
If you want to do something really cool you can change it's "(default)"
String-value to something like "Open My RB Application FileType". That's
the text that appears when you rightclick on the file. ;-)
10) Inside the open folder you can add a new folder "command" and here
you can give the path to the application that should open the filetype.
Lennox Jacob wrote:
Thanks,
i did not get a chance to try it as yet that is another project I was
working on, I will try it as soon as i get a chance.
Thanks again.
lennox.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|