GetStartupInfo function (Windows)

Switch View :
ScriptFree
GetStartupInfo function

Applies to: desktop apps only

Retrieves the contents of the STARTUPINFO structure that was specified when the calling process was created.

Syntax

VOID WINAPI GetStartupInfo(
  __out  LPSTARTUPINFO lpStartupInfo
);

Parameters

lpStartupInfo [out]

A pointer to a STARTUPINFO structure that receives the startup information.

Return value

This function does not return a value.

If an error occurs, the ANSI version of this function (GetStartupInfoA) can raise an exception. The Unicode version (GetStartupInfoW) does not fail.

Remarks

The STARTUPINFO structure was specified by the process that created the calling process. It can be used to specify properties associated with the main window of the calling process.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

Unicode and ANSI names

GetStartupInfoW (Unicode) and GetStartupInfoA (ANSI)

See also

CreateProcess
Process and Thread Functions
Processes
STARTUPINFO

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Community Content

dmex
C# syntax
[DllImport("kernel32", CharSet=CharSet.Auto)]
internal static extern void GetStartupInfo([In, Out] STARTUPINFO lpStartupInfo);

dmex
vb.net syntax
<DllImport("kernel32", CharSet:=CharSet.Auto)> _
Public Shared Sub GetStartupInfo(<[In], Out> ByVal lpStartupInfo As STARTUPINFO)
End Sub

sanketp
What exception does this throw?

"If an error occurs, GetStartupInfo can raise an exception."

Need better documentation, what exception can it raise?