Capture all Windows handles (HWND) and process IDs
Some functions like imagegrabwindow require the HWND to specify which window you want to copy.
Some functions like imagegrabwindow require the HWND (an integer value) to specify which window you want to copy. No problem if you start the process with
$x=new COM(...)
like in the examples at php.net. But how do you get the HWND of windows already opened? I've struggled with com_get_active_object but did not get too far. That's why I've written and compiled a C++ tool for collecting all active HWNDs and process IDs which can be accessed from PHP via the Windows shell. This opens many possibilities.
Download GETHWND.ZIP
Access via PHP
$x=shell_exec("gethwnd.exe");
Output structure:
HWND : Window Name : ProcessID;
$x will be a string containing the whole list like
0x40492;Perseus #1:472;0x405c2;SysFader:473;...