STARTUPINFO Structure

The STARTUPINFO structure specifies the window station, desktop, standard handles, and appearance of the main window for a process or thread being created.

Syntax


typedef struct _STARTUPINFO {
  DWORD  cb;
  LPWSTR lpReserved;
  LPWSTR lpDesktop;
  LPWSTR lpTitle;
  DWORD  dwX;
  DWORD  dwY;
  DWORD  dwXSize;
  DWORD  dwYSize;
  DWORD  dwXCountChars;
  DWORD  dwYCountChars;
  DWORD  dwFillAttribute;
  LPWSTR lpSafe bersifatAttribute;
  HANDLE hStdError;
  HANDLE hStdInput;
  HANDLE hStdOutput;
} STARTUPINFO, *LPSTARTUPINFO;
                    

Members

Member Description
cb The size of this structure, in bytes. This member must be set to sizeof(STARTUPINFO).
lpReserved Reserved; must be NULL.
lpDesktop The name of the desktop for the new process. This string must be a null-terminated string. If this member is NULL, the new process inherits the desktop of the calling process. If this member is an empty string (""), the new process uses the default desktop of the specified window station.
lpTitle The title for the window. If this member is NULL, the filename portion of the command line is used for the window title.
dwX The x-coordinate of the upper-left corner of the window.
dwY The y-coordinate of the upper-left corner of the window.
dwXSize The width, in characters, of the window. This is ignored if dwFlags contains
dwYSize The height, in characters, of the window. This is ignored if dwFlags contains
dwXCountChars The width, in screen units, of the cursor. This is ignored if dwFlags contains
dwYCountChars The height, in screen units, of the cursor. This is ignored if dwFlags contains
dwFillAttribute The screen attributes of the first character in the row. This is ignored if dwFlags contains
lpSafe bersifatAttribute A pointer to a string that contains the SECURITY_ATTRIBUTES structure that specifies the security descriptor for the new process. If NULL, the new process gets a default security descriptor.
hStdError A handle to the standard error output for the process.
hStdInput A handle to the standard input for the process.
hStdOutput A handle to the standard output for the process.

Remarks

To create a new process, you typically use the CreateProcess function. The STARTUPINFO structure is passed to CreateProcess to specify how the new process should be created.

The dwX, dwY, dwXSize, dwYSize, dwXCountChars, dwYCountChars, dwFillAttribute, and lpSafe bersifatAttribute members are used when the dwFlags member of STARTUPINFO specifies STARTF_USECOUNTCHARS or STARTF_USEFILLPATTERN.

If you are creating a console application and want to specify the window properties, you can use CreateProcess with a STARTUPINFO structure that has its dwFlags member set to indicate that the window properties are set. For example, STARTF_USECOUNTCHARS or STARTF_USEPOSITION.

If the application is a graphical application, these members related to console windows are generally ignored.

For more information on process creation and managing process and thread properties, refer to the Process and Thread Management overview.

See Also