diff --git a/app/SysTray-X/windowctrl-win.cpp b/app/SysTray-X/windowctrl-win.cpp index f8cd18d..8e32c3d 100644 --- a/app/SysTray-X/windowctrl-win.cpp +++ b/app/SysTray-X/windowctrl-win.cpp @@ -5,7 +5,8 @@ /* * System includes */ -#include +#include +#include #include /* @@ -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 */