ShellExecute

From Valve Developer Community
Revision as of 17:14, 28 June 2006 by Daktor (talk | contribs) (How to open external apps through code)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.