When you use
Code:
ExtractFilePath('grafica.exe');
your program tires to search for file named grafica.exe in your current directory also know as working directory which may not be the folder from which your application was launched and then extract its path. If the file can't be found in current directoy you will get empty path as a result.
So extract your program path using
Code:
MyAppPath := ExtractFilePath(Application.ExeName);
as I have suggested to you in the first place.
Now you already know what ExtractFilePath method does right.
And Application.ExeName property returns the full filename of your program executable from which you can extract path to the folder in which your executable resides.
Bookmarks