locked
Problem getting window handle in Windows 7 RRS feed

  • Question

  • Using Visual Basic 6 Sp6 I have a program that hides and shows the desktop icons. This program has worked fine in every windows version until Windows 7.

    The problem seems to be getting the handle to ShellDll_DefView Window, I can get the handle of Progman but when using FindWindowEx to get the handle of ShellDll_DefView it returns 0.

    In case there are some programmers here this is the code I am using:

    lValue = FindWindow("Progman", vbNullString)

    SHELLDLLDefView = FindWindowEx(lValue, 0&, "SHELLDLL_DefView", vbNullString) This returns 0

    If I use Spy++ and convert the handle shown for ShellDll_DefView from hex to long and then substitute it in this statement for lValue2

    lValue2 = FindWindowEx(lValue2, 0&, "SysListView32", vbNullString)

    Everything works fine. For some reason in Windows 7 I am unable to obtain the handle for ShellDll_DefView.

    I hope someone has some ideas about how to do this.

    Thanks,
    Norm
    Tuesday, August 11, 2009 10:06 PM

Answers

  • Matt,

    Thanks for the advice, I had asked the question on the microsoft.vbgeneraldiscusion forum and one person there suggested I ask here as he thought it was more a Windows 7 problem.

    Anyway I have figured out a way to do what I wanted, but don't understand why it changed. Apparently the ShellDll_DefView window is no longer found under the "Progman" window, but is under a window called WorkerW.

    Thanks,
    Norm
    Wednesday, August 12, 2009 9:46 PM

All replies

  • Hi Norm,

    The TechNet forums are geared more toward IT Pros than developers, for code-related questions, you'll probably get more replies on http://social.msdn.microsoft.com/Forums/en-US/windowscompatibility/threads


    -Matt
    Wednesday, August 12, 2009 8:40 PM
  • Matt,

    Thanks for the advice, I had asked the question on the microsoft.vbgeneraldiscusion forum and one person there suggested I ask here as he thought it was more a Windows 7 problem.

    Anyway I have figured out a way to do what I wanted, but don't understand why it changed. Apparently the ShellDll_DefView window is no longer found under the "Progman" window, but is under a window called WorkerW.

    Thanks,
    Norm
    Wednesday, August 12, 2009 9:46 PM