Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: VB4/32,VB5,VB6
Expertise: Intermediate
Jan 16, 2001



Building the Right Environment to Support AI, Machine Learning and Deep Learning

ActiveDesktop - Check whether Active Desktop is enabled or not

Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal _
    hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
    ByVal lpsz2 As String) As Long

' return True if ActiveDesktop is active

Function ActiveDesktop() As Boolean
    Dim hWindow As Long
    ' get the handle of Program Manager window
    hWindow = FindWindowEx(0, 0, "Progman", vbNullString)
    ' search for its child SHELLDLL_DefView window
    If hWindow Then
        hWindow = FindWindowEx(hWindow, 0, "SHELLDLL_DefView", vbNullString)
        ' finally, search for the Internet Explorer_Server grandchild window
        If hWindow Then
            ' if this call returns a non-zero handle, the computer
            ' is using ActiveDesktop
            If FindWindowEx(hWindow, 0, "Internet Explorer_Server", _
                vbNullString) Then
                ActiveDesktop = True
            End If
        End If
    End If
End Function
Francesco Balena
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date