I'm not sure how to explain this?

Blitz3D Forums/Blitz3D Programming/I'm not sure how to explain this?

DREAM(Posted 2007) [#1]
Say you make a new notepad for instance i'm not but just say.

can you make all txt files when clicked on, default to using this new blitz notepad.

I know i can make windows point to the new exe but can blitz be made have a file passed to it as a commandline or something like that or do i need some kind of .dll to do this.....

can it be programmed in blitz3D?

any ideas its just i have a savegame feature and i want the save games when clicked on to open the game and play the recorded game....


b32(Posted 2007) [#2]
Maybe you could use this dll ?


H&K(Posted 2007) [#3]
I dont know were it is, but windows keeps track of what programs it is supposed to use when you click on a file with an extention. I would assume you just write to this file that your application is the one that handels that file. Then (again assuming), the file path is sent you your app as a command line argument.

Im afraid I dont know B3d enough to say how you access these args, sorry


b32(Posted 2007) [#4]
I believe that is called 'file associations', the .dll I posted registers a file type, but I noticed the syntax description is missing. It is:
FileAssociate( Ext$, Name$, Icon$, Application$, Desc$ )

Where Ext$ is the extention, Name$ is the name of the new type, Icon$ is the icon associated with it, and Application$ is the application that should open the filetype. Desc$ is the type's description that appears in explorer. I hope it works, I did register a type with it once, but I didn't try to associate a program with it.


DREAM(Posted 2007) [#5]
You can right mouse on a file and 'Open With' then choose program, and then tick the always open with, thats not the problem i am having it is how do i get blitz3d to use the file, do i pass it as one long text argument.

does blitz3d when it has a file passed to it, read the file passed as a text string, i guess is what i am trying to get at.....


Yan(Posted 2007) [#6]
Something like...
file$ = Replace$(CommandLine$(), Chr$(34), "")
...should do the trick.


DREAM(Posted 2007) [#7]
i'll try that.....;)