WIP check parent process

This commit is contained in:
Ximi1970
2020-03-09 22:48:45 +01:00
parent 056bb92037
commit 1082342359

View File

@@ -5,7 +5,8 @@
/*
* System includes
*/
#include <tlhelp32.h>
#include <TlHelp32.h>
#include <Psapi.h>
#include <CommCtrl.h>
/*
@@ -64,6 +65,19 @@ qint64 WindowCtrlWin::getPpid()
}
/*
* Get the process name
*/
QString WindowCtrl::getProcessName( qint64 pid )
{
HANDLE proc = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, getPpid() );
char name[ 256 ];
GetModuleBaseNameA( proc, NULL, name, 256);
return QString( name );
}
/*
* Find the window by title
*/