通过注入绘制到桌面 [英] Drawing to the desktop via injection

查看:701
本文介绍了通过注入绘制到桌面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想绘制到桌面壁纸区域,特别是directX 9。在壁纸之上的象和文本下。
类似于Okozo或VLC的模式之一,或Dreamscene。

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 Dreamscene.

所以有很多类似的问题,但没有工作示例或教程。这< href =http://stackoverflow.com/questions/1176448/drawing-on-the-desktop-background-win32>一个类似的问题,但不同的方法似乎很有用。几年前,我在搜索并找到此网站和代码

So there's a lot of similar questions to this but no working examples or tutorials.This A simmilar question but different approach seems pretty useful. A few years ago I was searching and found this site and code.

这是完美的除了一个大问题的图标文字变得块状,即使使用alpha混合。我尝试了几个修复,但我没有能找到任何有用的文档,也许我只是没有使用正确的词语搜索,也许它的专有。我认为我固定的调用无效的桌面区域,但我不能真正地告诉,因为在过程中我搞砸了文本的alpha值,所以它不能正确绘制字体颜色。那么如何改变正确的alpha混合的文本?

It's perfect aside from one big issue the icon text gets blocky even with alpha blending. I tried a few fixes but I wasn't able to find any helpful documentation maybe I just wasn't using the right words for searching, maybe it's proprietary. I think I fixed that with a call to invalidate the desktop area but I can't really tell as in the process I messed up the alpha values for the text so it doesn't properly draw the font color. So how do I alter the text for proper alpha blending?

Pouet的链接都死了
我知道我应该发布一个代码段,但我不能固定其中的问题是,它是一个意想不到的功能。

Pouet's links are all dead I know I should post a snippet but I can't pin down where the problem is as it's more an unexpected feature.

推荐答案

我一直在搜索此代码太长时间。



我想编写一个Dreamscene像应用程序巫婆可以渲染除视频文件之外的动态内容,这可能是最令人满意的解决方案。

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.

我编译您的代码在VS2010 Win7x64并找到:

I compiled your code in VS2010 Win7x64 and found:

桌面图标文字变得透明,就像 Dreamscene 当窗口是:

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


  • 0x00150138程序管理器Progman


    • 0x000605D6SHELLDLL_DefView


      • 0x000C05BAFolderViewSysListView32

      桌面图标文字变得正常,但在窗口例如:

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


      • 0x000B007CWorkerW


        • 0x000605D6SHELLDLL_DefView


          • 0x000C05BAFolderViewSysListView32

          我尝试了此方法在Windows 8中绘制桌面图标,使窗口状态总是像第二个条件;并尝试使用D3D在 Workerg 窗口上绘制 WorkerW 窗口,但没有渲染。

          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.

          没有什么有用的,转储 memoryDC 使用的位图可能会有帮助,我会在后面尝试。

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

          自上次使用英语已经很久了,对不起我的错误。

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

          d3ddev-> BeginScene(); p>

          add this under d3ddev->BeginScene();

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

          并且:

          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;}
          

          仍在绘制listView,但工作窗口必须存在。此代码仅在启用 Aero Theme 的情况下运行。

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

          这篇关于通过注入绘制到桌面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆