What is the difference in calling a windows program?

I have a program on a computer running Windows XP on another continent. If I run it by double-clicking on the corresponding file so that it runs the program according to the file type association, it crashes at a certain point. If I run it by dragging the linked file onto the program icon, it works fine. If I double-click the icon and drag the linked file into the window, it works fine.

The guy on the site assures me that he checked the file type association three times, and that should be correct.

Assuming the icon points to the same executable file as the registry, what differences can occur when the program starts in these two different ways?

EDIT: In response to a comment, the machine I am having problems with works in Japanese, and my regular machine is in English.

+3
source share
2 answers

One possible difference is the initial working directory: if you drag and drop the file into an executable file, the original working directory is installed in the directory containing the executable file, whereas if you double-click the file, the original working directory will be set to some default value, regardless where the file or executable is located.

, SetCurrentDirectory(), , ; , , , GetModuleFileName(NULL, ...) , argv[0] main().

+3

() , , .

.

, , , . ? , , , , , .

, , , , , - , . , . - , , , , . , .

+1

Source: https://habr.com/ru/post/1710377/


All Articles