Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SHELLDLL_DefView does not work in Windows 7...

Status
Not open for further replies.

lidds

Programmer
Jun 9, 2005
72
GB
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?

Code:
    <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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top