static bool IsWorkingUnderNsightImpl() { PROCESSENTRY32 selfprocentry; if(GetParentPID(selfprocentry)) { std::string parentFileName = GetProcessFileName(selfprocentry.th32ParentProcessID); return parentFileName.find("Nsight.Monitor") != std::string::npos; } return false; }
static RString GetNewWindow() { HWND h = GetForegroundWindow(); if( h == NULL ) return "(NULL)"; DWORD iProcessID; GetWindowThreadProcessId( h, &iProcessID ); RString sName; GetProcessFileName( iProcessID, sName ); sName = Basename(sName); return sName; }