diff --git a/library/DFProcess-windows-SHM.cpp b/library/DFProcess-windows-SHM.cpp index 7941f8c73..aa9d50dfe 100644 --- a/library/DFProcess-windows-SHM.cpp +++ b/library/DFProcess-windows-SHM.cpp @@ -937,7 +937,8 @@ string SHMProcess::getPath() HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, d->process_ID ); //get the handle from the process ID EnumProcessModules(hProcess, &hmod, 1 * sizeof(HMODULE), &junk); //get the module from the handle GetModuleFileNameEx(hProcess,hmod,String,sizeof(String)); //get the filename from the module - return(string(String)); + string out(String); + return(out.substr(0,out.find_last_of("\\"))); } // get module index by name and version. bool 0 = error bool SHMProcess::getModuleIndex (const char * name, const uint32_t version, uint32_t & OUTPUT) diff --git a/library/DFProcess-windows.cpp b/library/DFProcess-windows.cpp index 697558c5b..9471116aa 100644 --- a/library/DFProcess-windows.cpp +++ b/library/DFProcess-windows.cpp @@ -512,5 +512,6 @@ string NormalProcess::getPath() char String[255]; EnumProcessModules(d->my_handle, &hmod, 1 * sizeof(HMODULE), &junk); //get the module from the handle GetModuleFileNameEx(d->my_handle,hmod,String,sizeof(String)); //get the filename from the module - return(string(String)); + string out(String); + return(out.substr(0,out.find_last_of("\\"))); } \ No newline at end of file