If I make a new file type for my program, how do I

2019-08-04 08:19发布

I made a program. I also made my own file type, which the program can create, open, and edit. In Explorer, I right clicked on this new file type and selected "Open With" and chose my program. Of course, it just opens the program without loading the file.

How do I let my program know that it's being requested to open a file on startup? Is there some command line argument that "Open With" sends?

1条回答
够拽才男人
2楼-- · 2019-08-04 08:38

Yes, Windows Explorer sends the path of the file as the command line argument to the executable of your application.

You could use args[0] in C# or argv[1] in C++ to read it.

查看更多
登录 后发表回答