Code : Tout sélectionner
Procedure ShowDesktop()
hWnd.l = FindWindow_( 0, 0 )
While hWnd <> 0
If GetwindowLong_(Hwnd, #GWL_STYLE) & #WS_VISIBLE = #WS_VISIBLE
If GetwindowLong_(Hwnd, #GWL_EXSTYLE) & #WS_EX_TOOLWINDOW <> #WS_EX_TOOLWINDOW
txt.s = Space(256)
GetWindowText_(hwnd, txt, 256)
If txt <> "" : ShowWindow_( hWnd, #SW_SHOWMINIMIZED ) : EndIf
EndIf
EndIf
hWnd = GetWindow_(hWnd, #GW_HWNDNEXT)
Wend
EndProcedure
ShowDesktop()