Skip to content

Latest commit

 

History

History
151 lines (101 loc) · 4.81 KB

nf-winuser-opendesktopw.md

File metadata and controls

151 lines (101 loc) · 4.81 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name req.apiset
NF:winuser.OpenDesktopW
OpenDesktopW function (winuser.h)
Opens the specified desktop object. (Unicode)
DF_ALLOWOTHERACCOUNTHOOK
OpenDesktop
OpenDesktop function [Windows Stations and Desktops]
OpenDesktopW
_win32_opendesktop
base.opendesktop
winstation.opendesktop
winuser/OpenDesktop
winuser/OpenDesktopW
winstation\opendesktop.htm
winstation
7f805f47-1737-4f4b-a74a-9c1423b65f2c
12/05/2018
DF_ALLOWOTHERACCOUNTHOOK, OpenDesktop, OpenDesktop function [Windows Stations and Desktops], OpenDesktopA, OpenDesktopW, _win32_opendesktop, base.opendesktop, winstation.opendesktop, winuser/OpenDesktop, winuser/OpenDesktopA, winuser/OpenDesktopW
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
OpenDesktopW (Unicode) and OpenDesktopA (ANSI)
User32.lib
User32.dll
Windows
19H1
OpenDesktopW
winuser/OpenDesktopW
c++
APIRef
kbSyntax
DllExport
User32.dll
Ext-MS-Win-NTUser-WindowStation-Ansi-L1-1-1.dll
Ext-MS-Win-NTUser-WindowStation-L1-1-2.dll
OpenDesktop
OpenDesktopA
OpenDesktopW
ext-ms-win-ntuser-windowstation-ansi-l1-1-1 (introduced in Windows 10, version 10.0.14393)

OpenDesktopW function

-description

Opens the specified desktop object.

-parameters

-param lpszDesktop [in]

The name of the desktop to be opened. Desktop names are case-insensitive.

This desktop must belong to the current window station.

-param dwFlags [in]

This parameter can be zero or the following value.

Value Meaning
DF_ALLOWOTHERACCOUNTHOOK
0x0001
Allows processes running in other accounts on the desktop to set hooks in this process.

-param fInherit [in]

If this value is TRUE, processes created by this process will inherit the handle. Otherwise, the processes do not inherit this handle.

-param dwDesiredAccess [in]

The access to the desktop. For a list of access rights, see Desktop Security and Access Rights.

-returns

If the function succeeds, the return value is a handle to the opened desktop. When you are finished using the handle, call the CloseDesktop function to close it.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

-remarks

The calling process must have an associated window station, either assigned by the system at process creation time or set by the SetProcessWindowStation function.

If the dwDesiredAccess parameter specifies the READ_CONTROL, WRITE_DAC, or WRITE_OWNER standard access rights, you must also request the DESKTOP_READOBJECTS and DESKTOP_WRITEOBJECTS access rights.

Note

The winuser.h header defines OpenDesktop as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

CloseDesktop

CreateDesktop

Desktops

OpenInputDesktop

SetProcessWindowStation

SetThreadDesktop

SwitchDesktop

Window Station and Desktop Functions