IntControl 51

Syntax:

IntControl (51, p1, 0, 0, 0)

 

Specifies flags for CreateProcess.

p1 = one or more of the following flags, combined using the binary "OR" ("|") operator. The default setting is 32.

In the 32-bit version, all the Run[..] commands call the Windows API "CreateProcess" function to launch the application. This IntControl lets you specify certain flags that control the priority class and the creation of the process, and affects all subsequent Run[..] commands. Under normal circumstances, you should not need to use this IntControl at all. It should be used only by knowledgeable users, and completely at your own risk. Some of these flags can have unexpected or undesirable results. We cannot provide any support for their use.

Returns previous setting

Value

Flag Name Meaning

DEBUG_PROCESS
If this flag is set, the calling thread starts and debugs the new process and all child processes created by the new process. It can receive all related debug events using the WaitForDebugEvent function. A process that uses DEBUG_PROCESS becomes the root of a debugging chain. This continues until another process in the chain is created with DEBUG_PROCESS.

If this flag is combined with DEBUG_ONLY_THIS_PROCESS, the caller debugs only the new process, not any child processes.

DEBUG_ONLY_THIS_PROCESS
If not set and the calling process is being debugged, the new process becomes another process being debugged by the calling process’s debugger. If the calling process is not a process being debugged, no debugging-related actions occur.

CREATE_SUSPENDED
The primary thread of the new process is created in a suspended state, and does not run until the ResumeThread function is called.

DETACHED_PROCESS
For console processes, the new process does not have access to the console of the parent process. The new process can call the AllocConsole function at a later time to create a new console. This flag cannot be used with the CREATE_NEW_CONSOLE flag.

16 

CREATE_NEW_CONSOLE
The new process has a new console, instead of inheriting the parent’s console. This flag cannot be used with the DETACHED_PROCESS flag.

512 

CREATE_NEW_PROCESS_GROUP
The new process is the root process of a new process group. The process group includes all processes that are descendants of this root process. The process identifier of the new process group is the same as the process identifier, which is returned in the lpProcessInformation parameter. Process groups are used by the GenerateConsoleCtrlEvent function to enable sending a CTRL+C or CTRL+BREAK signal to a group of console processes.

1024

CREATE_UNICODE_ENVIRONMENT
If set, the environment block pointed to by lpEnvironment uses Unicode characters. If clear, the environment block uses ANSI characters.

2048

CREATE_SEPARATE_WOW_VDM
Windows NT only: This flag is valid only when starting a 16-bit Windows-based application. If set, the new process is run in a private Virtual DOS Machine (VDM). By default, all 16-bit Windows-based applications are run as threads in a single, shared VDM. The advantage of running separately is that a crash only kills the single VDM; any other programs running in distinct VDMs continue to function normally. Also, 16-bit Windows-based applications that are run in separate VDMs have separate input queues. That means that if one application hangs momentarily, applications in separate VDMs continue to receive input.

4096

CREATE_SHARED_WOW_VDM
Windows NT only: The flag is valid only when starting a 16-bit Windows-based application. If the DefaultSeparateVDM switch in the Windows section of WIN.INI is TRUE, this flag causes the CreateProcess function to override the switch and run the new process in the shared Virtual DOS Machine.

65535

INHERIT_PARENT_AFFINITY
If set, the process inherits its parent's affinity. If the parent process has threads in more than one processor group, the new process inherits the group-relative affinity of an arbitrary group in use by the parent.

Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000:  This value is not supported.

262144

CREATE_PROTECTED_PROCESS
If set, the process is to be run as a protected process. The system restricts access to protected processes and the threads of protected processes. For more information on how processes can interact with protected processes, see Process Security and Access Rights.

To activate a protected process, the binary must have a special signature. This signature is provided by Microsoft but not currently available for non-Microsoft binaries. There are currently four protected processes: media foundation, audio engine, Windows error reporting, and system. Components that load into these binaries must also be signed. Multimedia companies can leverage the first two protected processes. For more information, see Overview of the Protected Media Path.

Windows Server 2003 and Windows XP/2000:  This value is not supported.

524288

EXTENDED_STARTUPINFO_PRESENT
If set, the process is created with extended startup information; the lpStartupInfo parameter specifies a STARTUPINFOEX structure.

Windows Server 2003 and Windows XP/2000:  This value is not supported.

16777216

CREATE_BREAKAWAY_FROM_JOB
The child processes of a process associated with a job are not associated with the job. If the calling process is not associated with a job, this constant has no effect. If the calling process is associated with a job, the job must set the JOB_OBJECT_LIMIT_BREAKAWAY_OK limit.

33554432

CREATE_PRESERVE_CODE_AUTHZ_LEVEL
Allows the caller to execute a child process that bypasses the process restrictions that would normally be applied automatically to the process.

Windows 2000:  This value is not supported.

67108864

CREATE_DEFAULT_ERROR_MODE
The new process does not inherit the error mode of the calling process. Instead, the new process gets the default error mode.  An application sets the current default error mode by calling SetErrorMode.

This feature is particularly useful for multi-threaded shell applications that run with hard errors disabled.

The default behavior is for the new process to inherit the error mode of the caller. Setting this flag changes that default behavior.

134217728

CREATE_NO_WINDOW
The process is a console application that is being run without a console window. Therefore, the console handle for the application is not set. This flag is ignored if the application is not a console application, or if it is used with either CREATE_NEW_CONSOLE or DETACHED_PROCESS.

 

These flags control the new process’s priority class, which is used in determining the scheduling priorities of the process’s threads. If none of the following priority class flags are specified, the priority class defaults to NORMAL_PRIORITY_CLASS unless the priority class of the creating process is IDLE_PRIORITY_CLASS. In this case, the default priority class of the child process is IDLE_PRIORITY_CLASS.

One of the following flags can be specified:

Value

Flag Name Meaning

32 

NORMAL_PRIORITY_CLASS
Indicates a normal process with no special scheduling needs.

64 

IDLE_PRIORITY_CLASS
Indicates a process whose threads run only when the system is idle and are preempted by the threads of any process running in a higher priority class. An example is a screen saver. The idle priority class is inherited by child processes.

128 

HIGH_PRIORITY_CLASS
Indicates a process that performs time-critical tasks that must be executed immediately for it to run correctly. The threads of a high-priority class process preempt the threads of normal-priority or idle-priority class processes. An example is Windows Task List, which must respond quickly when called by the user, regardless of the load on the operating system. Use extreme care when using the high-priority class, because a high-priority class CPU-bound application can use nearly all available cycles.

16384  

BELOW_NORMAL_PRIORITY_CLASS
Indicates a process that has priority above IDLE_PRIORITY_CLASS but below NORMAL_PRIORITY_CLASS.

Windows NT and Windows Me/98/95: This value is not supported.

32768

 ABOVE_NORMAL_PRIORITY_CLASS
Indicates a process that has priority above NORMAL_PRIORITY_CLASS but below HIGH_PRIORITY_CLASS.

Windows NT and Windows Me/98/95: This value is not supported.