Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You mentioned stats. try...</p> <pre> $wmi_call = "wmic process where \"name like '%php%'\" list statistics"; system($wmi_call, $output); var_dump($output); </pre> <p>My answer for alternatives to win api may be disheartening, but here it goes...</p> <p><a href="http://winbinder.org/" rel="nofollow noreferrer">Winbinder</a>, as well as providing functions to create GUI's, it has functions to load and work with dlls. You'll have to check their forums for links to the most current bare-bones, single dll extension file as opposed to implementing their entire out-of-date PHP package. Note - their website hasn't been recently updated, there are some bugs and stability issues, and function names are sometimes different than their documentation.</p> <p><a href="http://www.php.net/manual/en/class.com.php" rel="nofollow noreferrer">COM()</a> will get you closer, but still not far enough. See <a href="http://www.tuxradar.com/practicalphp/14/0/0" rel="nofollow noreferrer">this tuxradar.com article</a> on working with PHP/COM. Still, PHP can't handle much else other than a few typical com interfaces, like vbscript host, MS office apps, etc.</p> <p><a href="http://www.php.net/manual/en/class.dotnet.php" rel="nofollow noreferrer">DOTNET()</a> will get you even further. See <a href="http://www.peachpit.com/articles/article.aspx?p=27291" rel="nofollow noreferrer">this peachpit.com article</a> on the topic. Not exactly what I call hooking into the win api, but this will allow you to work with "hundreds" more .net classes and methods. See <a href="http://msdn.microsoft.com/en-us/library/ms229335.aspx" rel="nofollow noreferrer">msdn</a> for documentation on standard class libraries that come with the .net framework. Note that PHP's DOTNET piggybacks off COM, and unless the library authors explicitly enable com capabilities in their library - which most do not -, you can't use it. Also, this DOTNET class seems very limited and not mature. Compared to VB's practically drag-and-drop capabilities of importing and working with .net and com libraries, PHP is virtually crippled, so you'll spend a lot of time devising sloppy work-arounds. For example when making an interactive windows form in PHP, you can't do <code>$form_object-&gt;Controls-&gt;Add($button_object)</code> as you'd expect, but you can do <code>$button_object-&gt;Parent = $form_object</code>.</p> <p>I've personally tried implementing several com and .net libraries using COM() and DOTNET(), and only a handful worked... barely. IMHO, I'd recommend building, compiling, and registering as a .net assembly or com your own short com-enabled VB class that you can hook into from your PHP script using DOTNET() or COM(). The PHP manual pages and the the peachpit.com article linked above will explain. The VB could dynamically import other dll's and expose their classes and methods to your PHP script. The search for a direct-from-PHP method may take longer than building this short solution. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload