SHELLDLL_DefView does not work in Windows 7...

lidds

Well-known member
Joined
Oct 19, 2004
Messages
122
Programming Experience
Beginner
I am having a problem with my code now that I have changed from Vista to Windows 7. For some reason the following code does not work anymore in Windows 7. It seems that Progman is replaced by WorkerV. However I am unable to determine how to resolve this problem?

VB.NET:
    <Runtime.InteropServices.DllImport("User32.dll")> _
    Public Shared Function FindWindowEx(ByVal hwndParent As IntPtr, ByVal hwndChild As IntPtr, ByVal className As String, ByVal caption As String) As IntPtr
    End Function

    <Runtime.InteropServices.DllImport("User32.dll")> _
    Public Shared Function FindWindow(ByVal className As String, ByVal caption As String) As IntPtr
    End Function

    '/ Creates an Image object containing a screen shot of the entire desktop
    Public Function CaptureScreen() As Image
        Dim base As IntPtr = FindWindow("Progman", "Program Manager")
        Dim b2 As IntPtr = FindWindowEx(base, vbNullString, "SHELLDLL_DefView", vbNullString)
        b2 = FindWindowEx(b2, vbNullString, "SysListView32", vbNullString)

        Return CaptureWindow(b2)
    End Function 'CaptureScreen

Thanks for your help

Simon
 
I have not had exposure to Windows 7 devlopment yet but I am assuming referencing the 32 BIT windows API will need to be updated to point to the new Windows 7 64 bit api.
 
Back
Top