Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.25 KB

CloseDesktop.md

File metadata and controls

53 lines (34 loc) · 1.25 KB

Home

Function name : CloseDesktop

Group: Window Station and Desktop - Library: user32


Closes an open handle to a desktop object.


Code examples:

How to start the screen saver and how to find whether the screen saver is active
How to prevent users from accessing the Windows Desktop and from switching to other applications

Declaration:

BOOL CloseDesktop(
	HDESK hDesktop
);
  

FoxPro declaration:

DECLARE INTEGER CloseDesktop IN user32;
	INTEGER hDesktop  

Parameters:

hDesktop [in] Handle to the desktop to be closed. This can be a handle returned by the CreateDesktop, OpenDesktop, or OpenInputDesktop functions.


Return value:

If the function succeeds, the return value is nonzero.


Comments:

Do not specify the handle returned by the GetThreadDesktop function.

The CloseDesktop function will fail if any thread in the calling process is using the specified desktop handle or if the handle refers to the initial desktop of the calling process.

See also: CreateDesktop, OpenDesktop, OpenInputDesktop.