ShellExecute: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(How to open external apps through code)
 
No edit summary
Line 18: Line 18:


The file is also a const char * that points to the local file or webpage you want to access.
The file is also a const char * that points to the local file or webpage you want to access.
[[Category:Programming]][[Category:Interfaces]]

Revision as of 17:19, 28 June 2006

This is a short tutorial on how to launch external applications in the client's default handler. For example, launching a website or a word document in the client's default viewer.

This code must be in the client project:

#include "vgui\ISystem.h"
vgui::system()->ShellExecute(command, file);

The command is a const char * that can have the following values depending on what you're trying to accomplish: -open
-print
-explore
-play
-properties
-NULL

Look here for more information on each of the commands.

The file is also a const char * that points to the local file or webpage you want to access.