c++ - Drawing on the Desktop Background (WIN32) -


Is there a way to drag the desktop background into WWAN 32 and when the desktop background is republished then the notification gets is?

I tried to do this:

  desk = GetDesktopWindow (); DC = GETDESSY (desk); MoveToEx (DC, 0,0, zero); LineTo (DC, 16801050); ReleaseDC (Desk, DC);  

But it also pulls the entire screen over the window on the screen.

You can use Spy + + to find desktop + windows.

On my system I see the following hierarchy:

  • Window 000100098 "Program Manager" programmer
    • Window 0001009E "" SHELLDLL_DefView
      • Window 00100A0 "Folder View" SysListView32

I think you are discussing SysListView32 - Window with all the icons You can use it to find this window.

Edit You should use Combination of FindWindowEx and EnumerateChildWindows The following code can be compiled in a command line box like this: cl / EHsc finddesktop.cpp / dunicode / link user32.lib

  #include & lt; Windows h & gt; # Include & lt; Iostream & gt; #include & lt; String & gt; BOOL callback EnumChildProc (HWD, HWD, LPARAM lParam) {std :: wstring windowClass; WindowClass.resize (255); Unsigned int characters = :: realgate window class (hwnd, & quot; window class.bjin;), windowclassa (.)); WindowClass.resize (character); If (windowClass == L "SysListView32") {HWND * folderView = reinterpret_cast & lt; Hwnd * & gt; (LParam); * Folder View = hwnd; return false; } Return TRUE; } Int wmain () {HWND parentFolderView = :: FindWindowEx (0, 0, L "Programmer", "Program Manager"); If (parentFolderView == 0) {std :: wcout & lt; & Lt; L "Progman window could not be found, error: 0x" & lt; & Lt; Std :: hex & lt; & Lt; GetLastError () & lt; & Lt; Std :: endl; } HWND Folder View = 0; :: EnumChildWindows (parentFolderView, EnumChildProc, reinterpret_cast & lt; LPARAM & gt; (& amp; View Folder)); If (folderview == 0) {std :: wcout & lt; & Lt; L "FolderView window not found, error: 0x" & lt; & Lt; Std :: hex & lt; & Lt; GetLastError () & lt; & Lt; Std :: endl; } HWND Desktop Window = :: GetDesktopWindow (); Std :: wcout & lt; & Lt; L "View Folder:" & lt; & Lt; Folder view & lt; & Lt; Std :: endl; Std :: wcout & lt; & Lt; L "Desktop window:" & lt; & Lt; Desktop desktop & lt; & Lt; Std :: endl; Return 0; }  

After running finddesktop.exe, the results are here

  Folder view: 000100a Desktop window: 00010014  
< P> As you can see that window handles are quite different.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -