Answer the question
In order to leave comments, you need to log in
Launching a console application when a Drag&Drop C++ file is dragged onto it?
Good day, dear forum users!
When writing my application, I ran into an interesting question.
In short - I have a console converter that converts one file and creates a new one with a different extension. We need a mode for automatically launching the application and processing the source file when it is dragged onto the application shortcut. I write in C ++, and before that I did not encounter such issues. I googled, googled a lot, but there is mainly an implementation for window applications.
If anyone knows how to implement or where you can find information on this issue - I will be very grateful :)
Answer the question
In order to leave comments, you need to log in
Drag and drop simply launches the program by supplying the file name as a command line option. Those same argc and argv passed to main().
In addition, it is highly desirable (if you have Windows) to work in Unicode (in MinGW, the compiler setting is -municode, for other compilers, figure it out yourself). The main function changes to _wmain, its parameters to int argc, wchar_t** argv. Although not required if the paths do not contain extended characters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question