GetDesktopWindow function
Applies to: desktop apps only
Retrieves a handle to the desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which other windows are painted.
Syntax
HWND WINAPI GetDesktopWindow(void);
Parameters
This function has no parameters.
Return value
Type:
Type: HWND
The return value is a handle to the desktop window.
Examples
For an example, see Initializing a Dialog Box.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 2/3/2012
issue with sessions
on windows 7, if you are running as services, you must pay attention on the session you are taking the desktop.
- 8/12/2010
- Vinicius Hisao Suzuki
vb6 syntax
Private Declare Function GetDesktopWindow Lib "user32.dll" () As Long
- 3/17/2010
- luluthefirst
vb.net syntax
<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> _
Public Shared Function GetDesktopWindow() As IntPtr
End Function
C# syntax
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
public static extern IntPtr GetDesktopWindow();
- 4/25/2009
- dmex