I have done some searching in google but I can't seem to find anything.
Why I'm trying to do is this:
I have a proprietary file format that is associated to my application.
When I double click a file of that type it opens the application but doesn't actually open the file.
I want it to open the file.
How would I go about doing that?
Thank You.
Handling Files Opened In Win Explorer
Moderator: Coders of Rage
-
- Chaos Rift Regular
- Posts: 198
- Joined: Thu Mar 26, 2009 8:42 pm
- Current Project: My Engine
- Programming Language of Choice: C++
Handling Files Opened In Win Explorer
My first game: http://donsvoice.com/randomdever/Duck%2 ... 01.0.0.zip
My second game: http://donsvoice.com/randomdever/Space%20Invaders.zip
My third game: http://donsvoice.com/randomdever/BreakOut!.zip
My second game: http://donsvoice.com/randomdever/Space%20Invaders.zip
My third game: http://donsvoice.com/randomdever/BreakOut!.zip
- bbguimaraes
- Chaos Rift Junior
- Posts: 294
- Joined: Wed Apr 11, 2012 4:34 pm
- Programming Language of Choice: c++
- Location: Brazil
- Contact:
Re: Handling Files Opened In Win Explorer
Forgive me for being obvious, but isn't the file path passed as the first argument?
Code: Select all
int main(int argc, char ** argv) {
App app;
if(argc > 1)
app.open(argv[1]);
// ...
}
-
- Chaos Rift Regular
- Posts: 198
- Joined: Thu Mar 26, 2009 8:42 pm
- Current Project: My Engine
- Programming Language of Choice: C++
Re: Handling Files Opened In Win Explorer
Well thank you.
Now I finally know what those main parameters are for.
And it's now that obvious.
It's only obvious to someone who programs outside of DOS ( which I didn't ).
So thanks.
Now I finally know what those main parameters are for.
And it's now that obvious.
It's only obvious to someone who programs outside of DOS ( which I didn't ).
So thanks.
My first game: http://donsvoice.com/randomdever/Duck%2 ... 01.0.0.zip
My second game: http://donsvoice.com/randomdever/Space%20Invaders.zip
My third game: http://donsvoice.com/randomdever/BreakOut!.zip
My second game: http://donsvoice.com/randomdever/Space%20Invaders.zip
My third game: http://donsvoice.com/randomdever/BreakOut!.zip
- bbguimaraes
- Chaos Rift Junior
- Posts: 294
- Joined: Wed Apr 11, 2012 4:34 pm
- Programming Language of Choice: c++
- Location: Brazil
- Contact:
-
- Chaos Rift Newbie
- Posts: 6
- Joined: Sun Dec 05, 2010 11:25 am
- Favorite Gaming Platforms: Dreamcast, PC
- Programming Language of Choice: c++
Re: Handling Files Opened In Win Explorer
"I have a proprietary file format that is associated to my application.
When I double click a file of that type it opens the application but doesn't actually open the file."
How did you achieve this?
Opening my application from an unknown file?
When I double click a file of that type it opens the application but doesn't actually open the file."
How did you achieve this?
Opening my application from an unknown file?
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Handling Files Opened In Win Explorer
Windows associates file extensions with applications. This is why when you open a file with an extensions for which you do not have the proper application to open it with, you see the "Open With..." dialog which forces you to manually choose an application. When you check "Always use this application to open this file type", Windows saves that association as a key in the registry. You can associate any extension you want with your own application, but keep in mind that doing so will override an existing association. For example, if you associated the .txt extension with you application, double-clicking a text file will no longer open it in Notepad, or whatever you default text editor is, but rather with your application.jakson15 wrote:"I have a proprietary file format that is associated to my application.
When I double click a file of that type it opens the application but doesn't actually open the file."
How did you achieve this?
Opening my application from an unknown file?
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!