To do that you generally use the working directory plus relative paths.
For example if you can launch the executable from a command line, you CD to the directory you want to be the working directory and launch your executable from there.
| rem Executable is in D:\bin\
rem I want to launch it from D:\temp\
C:\> D:
D:\> CD temp
rem "D:\temp" is now the working directory (from were the program will execute).
D:\temp> ..\bin\executable.exe
rem Using "xxx.png" in the code of the program will search for the file in "D:\temp\".
rem You can use "path\to\a\sub\folder\xxx.png" in the code to access a sub folder of the working directory.
rem You can use "..\" in the code to move up the path. For example "..\parent\path\xxx.png" to access "D:\parent\path\xxx.png".
|
If you use Visual Studio to launch you program you can set the working directory in the project settings.
If you create a Windows Shortcut you can set the working directory in the "Start in" field.