Kernel32RegisterApplicationRestart Method

Registers the active instance of an application for restart.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
public static HResult RegisterApplicationRestart(
	string commandline,
	ApplicationRestartFlags flags
)

Parameters

commandline  String
A pointer to a Unicode string that specifies the command-line arguments for the application when it is restarted.

The maximum size of the command line that you can specify is RESTART_MAX_CMD_LINE characters.

Do not include the name of the executable in the command line; this function adds it for you.

If this parameter is NULL or an empty string, the previously registered command line is removed.

If the argument contains spaces, use quotes around the argument.

flags  ApplicationRestartFlags
Application restart flags.

Return Value

HResult
This function returns S_OK on success, or an HResult error codes on fail.

Remarks

See Also