RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

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