Drawing to the desktop via injection

前端 未结 1 1279
[愿得一人]
[愿得一人] 2021-01-03 15:49

I\'d like to draw to the desktop wallpaper area with directX 9 in particular. Under the icons and text above the wallpaper. Similar to Okozo or one of VLC\'s modes, or Dream

相关标签:
1条回答
  • 2021-01-03 16:27

    I've been searching for this code for too long.

    I'd like to write a Dreamscene like app witch can render dynamic contents other than just video files, and this one may be the most hopful solution.

    I compiled your code in VS2010 Win7x64 and found:


    Desktop icon text become transparent just like Dreamscene do when the window is like:

    • 0x00150138 "Program Manager" Progman
      • 0x000605D6 "" SHELLDLL_DefView
        • 0x000C05BA "FolderView" SysListView32

    Desktop icon text become normal but not clear enough when the window is like:

    • 0x000B007C "" WorkerW
      • 0x000605D6 "" SHELLDLL_DefView
        • 0x000C05BA "FolderView" SysListView32
      • 0x000C05BA "FolderView" SysListView32
    • 0x000511E2 "" WorkerW
    • 0x00150138 "Program Manager" Progman

    I tried this method Draw Behind Desktop Icons in Windows 8 to make the window status always be like the second condition; and tried to draw on WorkerW window above Progman window with D3D, but got nothing rendered out.

    So far there's nothing helpful, dumping the bitmap used by memoryDC may help, which I'll try latter.

    If you got any further approach, please let me know.

    It has been long time since I last use English, Sorry for my mistake if any.

    Update:Clear Icon Text got!

    add this under d3ddev->BeginScene();

    d3ddev->SetSamplerState(0,D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
    d3ddev->SetSamplerState(0,D3DSAMP_MAGFILTER, D3DTEXF_GAUSSIANQUAD);
    

    and this:

    HWND desktop = GetDesktopWindow();
    HWND explorer = FindWindowEx(desktop, 0, _T("Progman"), _T("Program Manager"));
    
    SendMessageTimeout(explorer, 0x052C, 0, 0, SMTO_NORMAL, 3000, NULL);
    
    HWND defView = 0;
    HWND worker = 0;
    while(!defView) {
        worker = FindWindowEx(desktop, worker, _T("WorkerW"), 0);
        if(worker) {
            defView = FindWindowEx(worker, 0, _T("SHELLDLL_DefView"), 0);
        }
        else break;
    }
    if (!worker){ /*DBG("First WorkerW failed");*/ return 0;}
    
    worker = FindWindowEx(desktop, (HWND)worker, _T("WorkerW"), 0); //find the next WorkerW
    if (!worker){ /*DBG("Created WorkerW not found");*/ return 0;}
    

    Still drawing on the listView, but worker window must exist. This code runs with Aero Theme enabled only.

    0 讨论(0)
提交回复
热议问题