Share via


ICcConnection::LaunchProcess (Windows Embedded CE 6.0)

1/5/2010

This method launches a specified process.

In Windows Embedded CE 6.0, CoreCon HLAPI has been deprecated.

Syntax

HRESULT LaunchProcess(
  LPCOLESTR in_szExecutable,
  LPCOLESTR in_szArgument,
  DWORD in_CreationFlags, 
  DWORD* out_pProcessID,
  DWORD* out_pProcessHandle
);

Parameters

  • in_szExecutable
    [in] The path to the executable file.

    This parameter can also designate a CSIDL special directory. For more information, see Remarks.

  • in_szArgument
    [in] Arguments for the executable process.
  • in_CreationFlags
    [in] Flags needed for process creation.

    The following flags are possible.

    Value Description

    Suspend

    Indicates the primary thread is created in a suspended state.

    DebugProcess

    If this flag is set, the calling process is treated as a debugger and the new process is a process being debugged.

    Child processes of the new process are also debugged.

    The system notifies the debugger of all debug events that occur in the process being debugged.

    If you create a process with this flag set, only the calling thread can call the WaitForDebugEvent function.

    debugonlythisprocess

    If this flag is set, the calling process is treated as a debugger, and the new process is a process being debugged.

    No child processes of the new process are debugged.

    The system notifies the debugger of all debug events that occur in the process being debugged.

    CreateNewConsole

    The new process has a new console, instead of inheriting the parent's console.

    InheritCallerPriority

    If this flag is set, the new process inherits the priority of the creator process.

  • out_pProcessID
    [out] PID of the launched process.
  • out_pProcessHandle
    [out] Process handle of the launched process. Can be NULL.

Return Value

If the method fails, it returns an HRESULT error code.

If the method succeeds, it returns one of the following:

Value Description

S_OK

Indicates the method call was successful.

E_INVALIDARG

Indicates invalid arguments.

Remarks

The user must call CloseProcessHandle to release a handle returned in out_pProcessHandle. If the handle is not released, a handle leak occurs.

The caller can specify a CSIDL file path for in_szDesktopFile and in_szDeviceFile using a special string substitution format.

CSIDL values provide a unique system-independent way to identify these special folders. The values supersede the use of environment variables for this purpose.

The format of the substitution string is %CSIDL_<tag>%\mydirectory\myfile.ext, where CSIDL_<tag> must be one of the following strings.

CSIDL_<tag> string Description

CSIDL_APPDATA

File system directory that serves as a common repository for application-specific data.

CSIDL_COMMON_APPDATA

File system directory containing application data for all users.

A typical path is C:\Documents and Settings\All Users\Application Data.

CSIDL_DESKTOPDIRECTORY

Prior to Windows CE .NET 4.2, not supported.

In Windows CE .NET 4.2 and later, the file system path to the desktop directory.

CSIDL_FAVORITES

File system directory that serves as a common repository for the user's favorite items.

CSIDL_FONTS

Virtual folder containing fonts.

CSIDL_PERSONAL

File system directory that serves as a common repository for documents.

CSIDL_PROFILE

Folder that contains the profile of the user.

CSIDL_PROGRAM_FILES

Program files folder.

CSIDL_PROGRAMS

File system directory that contains the user's program groups, which are also file system directories.

CSIDL_STARTMENU

File system directory that contains Start menu items.

CSIDL_STARTUP

File system directory that corresponds to the user's Startup program group.

The system starts these programs when a device is turned on.

CSIDL_WINDOWS

Windows folder.

Each of the CSIDL tags expands to the information provided by SHGetSpecialFolderPath. That is, the following string

%CSIDL_WINDOWS%\myfile.txt 

expands to \WINDOWS\myfile.txt, if SHGetSpecialFolderPath returns

\Windows

when passed CSIDL_WINDOWS.

The CSIDL_<tag> string must appear as the first element in the argument.

Requirements

Header ccconnection.h
Windows Windows 2000, Windows Server 2003, Windows Server 2003 Service Pack 1, Windows XP Home, Windows XP Pro

See Also

Reference

ICcConnection
Core Connectivity Interfaces