Hello.
I'm trying to get the path to the .exe, and add "bg.jpg" to the array to display the image that's in the same Path as the .exe...didn't work so far >.>
Any hints?:) thanks ahead.
What's this ? ImageBox_SetImage(hwndImage, PathBuffer + TEXT("\\bg.jpg"));
You need this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// header and library, for gcc is different
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib");
TCHAR PathBuffer [MAX_PATH];
GetModuleFileName(NULL, PathBuffer, MAX_PATH);
PathRemoveFileSpec(PathBuffer);
_tcscat(PathBuffer, TEXT("\\bg.jpg"));
// and then ...
ImageBox_SetImage(hwndImage, PathBuffer);