ShellExecute: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.
=void [[ISystem]]::'''ShellExecute'''(const char *command, const char *file)=
This gives insight on ShellExecute usage. For example, ShellExecute can launch a website or a word document in the client's default viewer.


This code must be in the client project:
<code>vgui\ISystem.h</code> must be included in the appropriate file.


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


  vgui::system()->ShellExecute(command, file);
<code>command</code> can have one of the following values:
*"open"  
*"print"
*"explore"
*"play"
*"properties"
*NULL
Look [http://vbnet.mvps.org/index.html?code/shell/shellexecute.htm here] for more information on each of the commands.


The command is a const char * that can have the following values depending on what you're trying to accomplish:
<code>file</code> points to the local file or webpage you want to access.
-open<br>
[[Category:ISystem]]
-print<br>
-explore<br>
-play<br>
-properties<br>
-NULL<br>
 
Look [http://vbnet.mvps.org/index.html?code/shell/shellexecute.htm 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.
 
[[Category:Programming]][[Category:Interfaces]]

Latest revision as of 19:37, 28 June 2006

void ISystem::ShellExecute(const char *command, const char *file)

This gives insight on ShellExecute usage. For example, ShellExecute can launch a website or a word document in the client's default viewer.

vgui\ISystem.h must be included in the appropriate file.

void ISystem::ShellExecute(const char *command, const char *file);
vgui::system()->ShellExecute(...);

command can have one of the following values:

  • "open"
  • "print"
  • "explore"
  • "play"
  • "properties"
  • NULL

Look here for more information on each of the commands.

file points to the local file or webpage you want to access.