Page 1 of 1

how to get vlc.exe path

Posted: 15 Feb 2009 09:32
by ahmad_aljallad
Dear all

How i can get the application path using the code in vlc
What is asking if i start vlc.exe i need the application?
To get the path for vlc.exe on the H.D.D.

Thanks

Re: how to get vlc.exe path

Posted: 15 Feb 2009 13:13
by RĂ©mi Denis-Courmont
HKLM/Software/VideoLAN/VLC/InstallDir

Re: how to get vlc.exe path

Posted: 15 Feb 2009 13:44
by ahmad_aljallad
Any how this problem solved the solution if anybody need it is

Code: Select all

using std::string; char szAppPath[MAX_PATH] = ""; string strAppDirectory; ::GetModuleFileName(NULL, szAppPath, sizeof(szAppPath) - 1);
this for getting the application file path

Code: Select all

strAppDirectory = szAppPath; strAppDirectory = strAppDirectory.substr(0, strAppDirectory.rfind("\\")); strAppDirectory =strAppDirectory+"\\vlc-Documents\\vlc16x16.png";
this for extracting directory

Code: Select all

const char *p; p=strAppDirectory.c_str();
this for converting from string to char so you can assign it
To Qicon function if you need to change vlc icons.

=========================================================================
putting all to geter

Code: Select all

using std::string; char szAppPath[MAX_PATH] = ""; string strAppDirectory; ::GetModuleFileName(NULL, szAppPath, sizeof(szAppPath) - 1); // Extract directory strAppDirectory = szAppPath; strAppDirectory = strAppDirectory.substr(0, strAppDirectory.rfind("\\")); strAppDirectory =strAppDirectory+"\\vlc-Documents\\vlc16x16.png"; //test======================= // string l="Pranav"; const char *p; p=strAppDirectory.c_str();