I would like to code a function to which you can pass a file path, for example:
C:\\FOLDER\\SUBFOLDER\\FILE.TXT
and it would open Windows E
To follow up on @Mahmoud Al-Qudsi's answer. when he says "launching the process", this is what worked for me:
// assume variable "path" has the full path to the file, but possibly with / delimiters
for ( int i = 0 ; path[ i ] != 0 ; i++ )
{
if ( path[ i ] == '/' )
{
path[ i ] = '\\';
}
}
std::string s = "explorer.exe /select,\"";
s += path;
s += "\"";
PROCESS_INFORMATION processInformation;
STARTUPINFOA startupInfo;
ZeroMemory( &startupInfo, sizeof(startupInfo) );
startupInfo.cb = sizeof( STARTUPINFOA );
ZeroMemory( &processInformation, sizeof( processInformation ) );
CreateProcessA( NULL, (LPSTR)s.c_str(), NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &processInformation );