Re: launching external app without flashing of cmd window
| From: | Elizabeth Smith | Date: | Thu, 05 Oct 2006 19:28:37 +0000 |
| Subject: | Re: launching external app without flashing of cmd window | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7326@lists.php.net to get a copy of this message | ||
kksou wrote:
When running php-gtk using php-win on windows, and launching external application from within php-gtk, one will always see a brief flashing of a cmd window. For those interested, I've posted a solution which we have been using for some time at: http://www.kksou.com/php-gtk2/articles/launch-external-app-in-winxp-without-the-flashing-of-cmd-window.php It basically make use of a freeware utility called cmdow utility from http://www.commandline.co.uk/cmdow/ that allows you to hide a command window. We find this a great tool for interfacing php-gtk with external applications, e.g. open a url in browser or playing a mp3 file using an external player. /kksouThat's kind of way overkill to launch a url/email address on windows xp... and you have to use a non open-source extra application which several antivirus programs flag... The trick to launching an external url/email/even generic file on windows is to use the start command (useful for launching files with the registered program so you're not one of those annoying people who open IE when I use firefox) The trick to get around the flashing dos window is to use com and WScript.Shell $shell = new COM('WScript.Shell'); $shell->Run('cmd /c start "" "' . $url . '"', 0, FALSE); unset($shell); I've also found this is about three times as fast as exec or popen on XP