Re: w32api GUI
| From: | Bill Zeller | Date: | Thu, 25 Mar 2004 19:36:52 +0000 |
| Subject: | Re: w32api GUI | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-23277@lists.php.net to get a copy of this message | ||
Hi,
The FFI extension works great and seems to be more intuitive than w32api.
Thanks for your help.
-bill
"Dvdmandt" <dvdmandt@telia.com> wrote in message
news:20040325184212.48978.qmail@pb1.pair.com...
> Hi.. Intresting idea, but you really should forget about that extension..
It
> doesn't really work, it's no longer under development and it's not
supported
> afaik.. :p In PHP5, a new extension, named FFI will replace w32api.. I
don't
> think it's included, so you'll have to get it from pecl or snaps.php.net..
>
> Also, shouldn't you use some hWnd? 0 seems a bit bad... :p But anyway, I
> don't really have any idea what I'm writing about..
>
>
> Oh, and you might wanna try other PHP versions.. I had code working in
4.2.*
> and maybe even 4.3.0, that doesn't work with latest versions...
> --
> // DvDmanDT
> MSN: dvdmandt¤hotmail.com
> Mail: dvdmandt¤telia.com
> "Bill Zeller" <bill@zempt.com> skrev i meddelandet
> news:20040325024801.32333.qmail@pb1.pair.com...
> > 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