User32GetThreadDesktop Method
Retrieves a handle to the desktop assigned to the specified thread.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", ExactSpelling = true, SetLastError = true)]
public static IntPtr GetThreadDesktop(
uint threadId
)
<DllImportAttribute("User32.dll", ExactSpelling := true, SetLastError := true>]
Public Shared Function GetThreadDesktop (
threadId As UInteger
) As IntPtr
Dim threadId As UInteger
Dim returnValue As IntPtr
returnValue = User32.GetThreadDesktop(threadId)
public:
[DllImportAttribute(L"User32.dll", ExactSpelling = true, SetLastError = true)]
static IntPtr GetThreadDesktop(
unsigned int threadId
)
[<DllImportAttribute("User32.dll", ExactSpelling = true, SetLastError = true)>]
static member GetThreadDesktop :
threadId : uint32 -> IntPtr
No code example is currently available or this language may not be supported.
- threadId UInt32
-
The thread identifier. The GetCurrentThreadId
and CreateProcess(String, StringBuilder, SecurityAttributes, SecurityAttributes, Boolean, CreateProcessFlags, IntPtr, String, ProcessStartupInfo, ProcessInformation) functions return thread identifiers.
IntPtr
If the function succeeds, the return value is a handle to the desktop associated with the specified thread.
You do not need to call the
CloseDesktop(IntPtr) function to close the returned handle.
If the function fails, the return value is
Zero.