PHP Programmer Development Win32 Application Dream

Source: Internet
Author: User

I believe that the PHP programmers who do pure web development will think, if PHP can develop Windows local applications, and so on the internet a lot of the search out is "PHP-GTK" old article, this thing seems to have no one to maintain, casually looked under, also did not go to fine study.


Before the Node-webkit, this thing can be used JavaScript + Chorme kernel blink to develop native applications, to meet the dream of pure web programmers to develop native applications.

Node-webkit has several advantages:

1, built-in blink kernel, follow the Google upgrade, support the modern browser features, mom no longer have to worry about my browser compatibility issues

2, built-in Nodejs, is the strengthening version of the Javascript,web programmer to start fast, Nodejs powerful

3, the entry-level development process is relatively simple, there is not too much to see things

4, cross-platform, three major operating systems are available

5, the Chinese open source project, is now very popular on GitHub

Cons: Too much volume. Write a Hello wold, uh, above 20M. Tried a lot of compression methods, the minimum is more than 17M, headache

Youdao dictionary before the array also open source a similar item: Call Youdao hex, but I compare optimistic node-webkit, community more active more mature.


Because oneself is phper, the nature is to write PHP to be enough sour cool, then think other solution.

There is a green PHP Web server software, so that the software can be made green version, do not have to install Apache Nginx and other things.

Kung Fu, found a good thing called quickphp, the author is intended to do a convenient quick-mode PHP script tool, Fluke, received.

Study for a while, found that Delphi wrote the software, with exescope processing, modify a few words and menus, try not to show that the goods are quickphp

Then use the C + + edge to learn to develop, make a simple browser, in fact, is to generate a form, get an IE control up. When you start the form, start quickphp with C code, and then hide the quickphp form.

(There is a problem not solved, otherwise it is more perfect, minimized, hide the icon on the managed bar is troublesome, WinXP and Win7 processing methods are not the same, their C ability is too poor, first give up optimization)


Toss two days, the results

Run Localphp.exe to see the effect


where php.ini and ext directories are not required, in order to use some PHP extensions to add

Remove the non-essential extension Directory (EXT), the rest of the file package compression is small a few m, still satisfied


The function in the demo takes advantage of JS's asynchronous request and achieves no flush operation. Of course, you can also optimize CSS style, prohibit JS error, prohibit copying text, prohibit the right-click menu and other means to make it look more like the client

PHP itself has a lot of functions that can control the operating system, plus the ability to execute command line code with exec (), so PHP can do a lot of things.


In addition to the above mentioned PHP can do, in fact, still want to let PHP can invoke the DLL file in the system, it is awesome. Imagine, using PHP to find the handle, call out want to chat friends window, automatically send messages to want friends, many beautiful scenes ...


Looking for a half-day, found two extensions php_w32api.dll and Php_ffi.dll, unfortunately seems to have no one maintenance, the new version of PHP can not be used. Interested in the ability of students, you can go to the official PHP to find, optimize, compile a copy for me, thank you very much.



To summarize, in the course of these days to realize the idea, benefited a lot:

1, PHP incredibly as long as a php5ts.dll can run, and SAPI is what

2, C + + is actually not so scary, learning to go in or very interesting

3, the method is always more difficult than


Next you want to refine two pieces:

First, completely hide the Web server server, that is, the quickphp or make a Web server

Second, complete the use of Web control Wang Wang Send message function. The idea could be

1, with the extension of PHP (as mentioned above W32api and FFI) to call the system DLL;

2, write their own PHP extension, in the expansion of the implementation of the message to send Wang Wang;

3, in the main form to send Wang Wang message, through a mechanism to let PHP notice to C

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.