The php_gtk.exe/php_win.exe
| From: | florian at phpws dot org | Date: | Sun, 19 Dec 2004 22:37:16 +0000 |
| Subject: | The php_gtk.exe/php_win.exe | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-830@lists.php.net to get a copy of this message | ||
Hi!
Sometimes I've asked me, whats the difference between the php_gtk.exe and the php_win.exe.
So, the difference is only that the php_gtk.exe is also aviable to make associations to the file name extension *.php-gtk. Or is there any other feature I don't know about?
For the php_win.exe I asked myself why there is so much source code when somethin like the following should work also..
#include <stdio.h> #include <stdlib.h> #include <windows.h> #define EXE_FILENAME "phpgtk.exe" void basedir(char *path, char *buffer, int buffer_size) { char res[buffer_size], cache[buffer_size]; int pos=0, len=0; //Length of path.. len = strlen(path)-strlen(EXE_FILENAME); //Put firs character to res.. sprintf(res, "%c%", path[0]); //Cache chars to lenght of path.. for(pos=1;pos<len;pos++) { sprintf(res, "%s%c", res, path[pos]); } //return result.. strcpy(buffer, res); }So, please help me: Why and When it's better to use one of those (php_gtk/php_win.exe)? I don't understand :-/ Sorry if my question is absurd, but was confused about this.. Regards, Florian Was verdammt ist ein Mail Trailor?int main(int argc, char *argv[]){ char dir[500], php_file[500], php_path[500]; //The paths.. basedir(argv[0], php_path, 500); sprintf(php_path, "\"%s\\php.exe\"", php_path); strcpy(php_file, argv[1]); //Run it.. ShellExecute(NULL, NULL, php_path, php_file, NULL, SW_HIDE); return 0; } (not tested yet)