###User Defined Function###
_WinAPI_CreateDesktop

###Description###
Creates a new desktop, associates it with the current window station of the calling process.

###Syntax###
#include <WinAPISys.au3>
_WinAPI_CreateDesktop ( $sName [, $iAccess = 0x0002 [, $iFlags = 0 [, $iHeap = 0 [, $tSecurity = 0]]]] )


###Parameters###
@@ParamTable@@
$sName
	The name of the desktop to be created. Desktop names are case-insensitive and may not contain backslash characters (\).
$iAccess
	[optional] The requested access to the desktop. This parameter can be one or more of the following values:
		$DESKTOP_ALL_ACCESS
		$DESKTOP_CREATEMENU
		$DESKTOP_CREATEWINDOW (Default)
		$DESKTOP_ENUMERATE
		$DESKTOP_HOOKCONTROL
		$DESKTOP_JOURNALPLAYBACK
		$DESKTOP_JOURNALRECORD
		$DESKTOP_READOBJECTS
		$DESKTOP_SWITCHDESKTOP
		$DESKTOP_WRITEOBJECTS
$iFlags
	[optional] The optional flags. It can be zero or the following value:
		$DF_ALLOWOTHERACCOUNTHOOK
$iHeap
	[optional] The size of the desktop heap, in kilobytes. Default is 0.
$tSecurity
	[optional] $tagSECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes.
	If this parameter is 0 (Default), the handle cannot be inherited .
@@End@@

###ReturnValue###
@@ReturnTable@@
Success 	Handle to the newly created desktop. If the specified desktop already exists, the function succeeds and returns a handle to the existing desktop.
Failure 	0, call <a href="_WinAPI_GetLastError.htm">_WinAPI_GetLastError()</a> to get extended error information.
@@End@@


###Remarks###
The number of desktops that can be created is limited by the size of the system desktop heap.
You can increase the number of desktops that can be created by increasing the size of the desktop heap or by reducing the default heap reserved for each desktop in the interactive window station.
The default size of the desktop heap depends on factors such as hardware architecture.
To retrieve the size of the heap, call the <a href="_WinAPI_GetUserObjectInformation.htm">_WinAPI_GetUserObjectInformation()</a> function with $UOI_HEAPSIZE.

When you are finished using the desktop, call the <a href="_WinAPI_CloseDesktop.htm">_WinAPI_CloseDesktop()</a> function to close it.


###Related###
_WinAPI_GetUserObjectInformation, _WinAPI_CloseDesktop


###See Also###
@@MsdnLink@@ CreateDesktopEx


###Example###
@@IncludeExample@@
