Open with
-
- In need of some credit
- Posts: 3
- Joined: Sat Jan 23, 2021 8:56 pm
Open with
Is there a way to control what happens when someone opens a file with my program with wxWidgets or any other C++ library?
Re: Open with
In the case of "open with..." the same thing happens as if the user had dragged and dropped a file onto your executable: The xecutable will be started and the path of the dropped file will be passed as command line arguments, argc/argv.
http://crasseux.com/books/ctutorial/argc-and-argv.html
As the main() function is usually not exposed in wxWidgets, you can access argc/argv through wxAppConsole::argc/argv
https://docs.wxwidgets.org/trunk/classw ... 31a5e8bfc5
http://crasseux.com/books/ctutorial/argc-and-argv.html
As the main() function is usually not exposed in wxWidgets, you can access argc/argv through wxAppConsole::argc/argv
https://docs.wxwidgets.org/trunk/classw ... 31a5e8bfc5
Use the source, Luke!
-
- In need of some credit
- Posts: 3
- Joined: Sat Jan 23, 2021 8:56 pm
Re: Open with
How would I obtain this file path you speak of? Also, please note, I don't need cross platform answers, but they would be nice. Also, if there is a way that isn't using wxwidgets, please tell me.
Re: Open with
The first link i posted explains exactly what you have to do.Moogamouth wrote: ↑Sun Jan 24, 2021 5:21 am How would I obtain this file path you speak of? Also, please note, I don't need cross platform answers, but they would be nice. Also, if there is a way that isn't using wxwidgets, please tell me.
Use the source, Luke!
-
- In need of some credit
- Posts: 3
- Joined: Sat Jan 23, 2021 8:56 pm
Re: Open with
Sorry.