Funzione GetThreadDesktop (winuser.h)

Recupera un handle sul desktop assegnato al thread specificato.

Sintassi

HDESK GetThreadDesktop(
  [in] DWORD dwThreadId
);

Parametri

[in] dwThreadId

Identificatore del thread. Le funzioni GetCurrentThreadId e CreateProcess restituiscono identificatori di thread.

Valore restituito

Se la funzione ha esito positivo, il valore restituito è un handle per il desktop associato al thread specificato. Non è necessario chiamare la funzione CloseDesktop per chiudere l'handle restituito.

Se la funzione ha esito negativo, il valore restituito è NULL. Per informazioni dettagliate sull'errore, chiamare GetLastError.

Commenti

Il sistema associa un desktop a un thread al momento della creazione di tale thread. Un thread può usare la funzione SetThreadDesktop per modificare il desktop. Il desktop associato a un thread deve trovarsi nella stazione finestra associata al processo del thread.

Il processo chiamante può usare l'handle restituito nelle chiamate alle funzioni GetUserObjectInformation, GetUserObjectSecurity, SetUserObjectInformation e SetUserObjectSecurity .

Un'applicazione di servizio viene creata con una stazione finestra associata e un desktop, quindi non è necessario chiamare una funzione USER o GDI per connettere il servizio a una stazione finestra e a un desktop.

Requisiti

Requisito Valore
Client minimo supportato Windows 2000 Professional [solo app desktop]
Server minimo supportato Windows 2000 Server [solo app desktop]
Piattaforma di destinazione Windows
Intestazione winuser.h (include Windows.h)
Libreria User32.lib
DLL User32.dll
Set di API ext-ms-win-ntuser-windowstation-l1-1-0 (introdotto in Windows 8)

Vedi anche

Desktop

GetCurrentThreadId

GetProcessWindowStation

GetUserObjectInformation

GetUserObjectSecurity

SetProcessWindowStation

SetThreadDesktop

SetUserObjectInformation

SetUserObjectSecurity

Funzioni di windows e desktop