Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使墙纸窗口可点击_C#_Input_Pinvoke_Wallpaper - Fatal编程技术网

C# 使墙纸窗口可点击

C# 使墙纸窗口可点击,c#,input,pinvoke,wallpaper,C#,Input,Pinvoke,Wallpaper,我创建了一个库,允许您使用user32.dll将任何窗口移到桌面图标后面,但问题是窗口对单击或按键都没有反应(即使键盘设备似乎也没有捕捉到任何东西) 但需要注意的是,当我在墙纸层上运行任何窗口后,它就会从任务栏中消失 这是代码: public static void MoveBehindIcons(IntPtr windowHandle) { IntPtr window = W32.FindWindow("Progman", (string) null);

我创建了一个库,允许您使用
user32.dll
将任何窗口移到桌面图标后面,但问题是窗口对单击或按键都没有反应(即使键盘设备似乎也没有捕捉到任何东西)

但需要注意的是,当我在墙纸层上运行任何窗口后,它就会从任务栏中消失

这是代码:

    public static void MoveBehindIcons(IntPtr windowHandle)
    {
      IntPtr window = W32.FindWindow("Progman", (string) null);
      IntPtr result = IntPtr.Zero;
      int num1 = 1324;
      IntPtr wParam = new IntPtr(0);
      IntPtr zero = IntPtr.Zero;
      int num2 = 0;
      int num3 = 1000;
      W32.SendMessageTimeout(window, (uint) num1, wParam, zero, (W32.SendMessageTimeoutFlags) num2, (uint) num3, out result);
      IntPtr workerw = IntPtr.Zero;
      W32.EnumWindows((W32.EnumWindowsProc) ((tophandle, topparamhandle) =>
      {
        if (W32.FindWindowEx(tophandle, IntPtr.Zero, "SHELLDLL_DefView", IntPtr.Zero) != IntPtr.Zero)
          workerw = W32.FindWindowEx(IntPtr.Zero, tophandle, "WorkerW", IntPtr.Zero);
        return true;
      }), IntPtr.Zero);
      W32.SetParent(windowHandle, workerw);
    }
W32类:

我的引擎能做到这一点


有没有可能做到这一点?

你能至少解释一下为什么你否决了请投票的人吗?请参阅msdn帖子:@TomLenc:是的,这不是“这里”,也不是看到问题所需的最低代码。请看,代码链接的一个主要问题是,将来查看相同问题的人不会看到相同的代码,因此问题和答案没有意义。请记住,堆栈溢出是问答百科全书,而不是帮助服务。我们希望答案能帮助其他有类似问题的程序员。@DavidHeffernan我已经这样做了