Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use Spy++ to find which window is the desktop background window. </p> <p>On my system I see the following hierarchy:</p> <ul> <li>Window 000100098 "Program Manager" Progman <ul> <li>Window 0001009E "" SHELLDLL_DefView <ul> <li>Window 00100A0 "FolderView" SysListView32</li> </ul></li> </ul></li> </ul> <p>I guess you are referring to the SysListView32 - the window with all the icons. You can use <a href="http://msdn.microsoft.com/en-us/library/ms633500%28VS.85%29.aspx" rel="noreferrer">FindWindowEx</a> to find this window.</p> <p><strong>Edit</strong> You should use a combination of FindWindowEx and EnumerateChildWindows. The code presented below can be compiled in a command line box like this: <code>cl /EHsc finddesktop.cpp /DUNICODE /link user32.lib</code></p> <pre><code>#include &lt;windows.h&gt; #include &lt;iostream&gt; #include &lt;string&gt; BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) { std::wstring windowClass; windowClass.resize(255); unsigned int chars = ::RealGetWindowClass(hwnd, &amp;*windowClass.begin(), windowClass.size()); windowClass.resize(chars); if (windowClass == L"SysListView32") { HWND* folderView = reinterpret_cast&lt;HWND*&gt;(lParam); *folderView = hwnd; return FALSE; } return TRUE; } int wmain() { HWND parentFolderView = ::FindWindowEx(0, 0, L"Progman", L"Program Manager"); if (parentFolderView == 0) { std::wcout &lt;&lt; L"Couldn't find Progman window, error: 0x" &lt;&lt; std::hex &lt;&lt; GetLastError() &lt;&lt; std::endl; } HWND folderView = 0; ::EnumChildWindows(parentFolderView, EnumChildProc, reinterpret_cast&lt;LPARAM&gt;(&amp;folderView)); if (folderView == 0) { std::wcout &lt;&lt; L"Couldn't find FolderView window, error: 0x" &lt;&lt; std::hex &lt;&lt; GetLastError() &lt;&lt; std::endl; } HWND desktopWindow = ::GetDesktopWindow(); std::wcout &lt;&lt; L"Folder View: " &lt;&lt; folderView &lt;&lt; std::endl; std::wcout &lt;&lt; L"Desktop Window: " &lt;&lt; desktopWindow &lt;&lt; std::endl; return 0; } </code></pre> <p>Here are the results after running finddesktop.exe</p> <pre><code>Folder View: 000100A0 Desktop Window: 00010014 </code></pre> <p>As you can see the window handles are quite different.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload