w32api GUI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey guys,

I have a non-standard question regarding Windows programming.

My objective is to create a small PHP wrapper for some basic win32 api
stuff, such as creating message boxes and some dialog windows. This would be
used for windows command line scripting, not for web development. I realize
php-gtk exists, but I'd like to do this mainly for the native widget-ness
and to learn more about the windows API.

I have three questions.

(using windows xp pro and php-4.3.4)
1) What's wrong with this code? The documentation is not up to date, and
this should work. (other functions, using the same idea, do work. For
example, "long GetTickCount () From Kernel32.dll" works fine)

<?php
if (!dl("php_w32api.dll")) {
  echo "Unable to load php_w32api.dll";
  exit;
}

$api = new win32;
$api->registerfunction("long MessageBox (long hWnd, string lpText, string
lpCaption, long uType) from User32.dll");

if ($api->MessageBox(0, "testing", "testing somemore", 0) == 0)
{
    echo "failed";
}else{
    echo "succeeded";
}
?>

(nothing happens and failed is always printed)

2) Will this be supported in PHP 5? I downloaded RC 1 and don't see a
php_w32api.dll in the extensions directory.

3) Do you know another way of accessing functions in dlls on windows?

Thanks

Best Regads,
Bill Zeller

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux