How can I call Win32 API calls from PHP?

I know I can use COM components, but is there a way to call directly to Win32 API (user32.dll, advapi32.dll, etc.) from PHP or do I need to wrap a PHP extension or COM object?

+2


source to share


2 answers


Win32api support for php is very flaky. Look at this



http://php.net/manual/en/book.w32api.php

+1


source


See the first comment here :

The only way I have been able to call Win32 API functions using PHP5 is through COM and DynamicWrapper.

Here's an example of how to play a beep using a computer speaker:



<?php
$com = new COM("DynamicWrapper");
$com->Register("KERNEL32.DLL", "Beep", "i=ll", "f=s", "r=l");
$com->Beep(5000, 100);
?>

      

You can get the updated DynamicWrapper here . You have to register it with regsvr32.

+4


source







All Articles