mirror of
https://github.com/Ximi1970/systray-x.git
synced 2026-05-07 00:56:52 +02:00
WIP check parent process
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user