• <i id='46G5T'><tr id='46G5T'><dt id='46G5T'><q id='46G5T'><span id='46G5T'><b id='46G5T'><form id='46G5T'><ins id='46G5T'></ins><ul id='46G5T'></ul><sub id='46G5T'></sub></form><legend id='46G5T'></legend><bdo id='46G5T'><pre id='46G5T'><center id='46G5T'></center></pre></bdo></b><th id='46G5T'></th></span></q></dt></tr></i><div id='46G5T'><tfoot id='46G5T'></tfoot><dl id='46G5T'><fieldset id='46G5T'></fieldset></dl></div>

      <legend id='46G5T'><style id='46G5T'><dir id='46G5T'><q id='46G5T'></q></dir></style></legend>

    1. <tfoot id='46G5T'></tfoot>
        <bdo id='46G5T'></bdo><ul id='46G5T'></ul>

        <small id='46G5T'></small><noframes id='46G5T'>

        在 C# 中隐藏 Vista/Win 7 上的 Start Orb

        时间:2023-10-24

        <legend id='U9tAt'><style id='U9tAt'><dir id='U9tAt'><q id='U9tAt'></q></dir></style></legend>
        • <bdo id='U9tAt'></bdo><ul id='U9tAt'></ul>
          <tfoot id='U9tAt'></tfoot>

            <small id='U9tAt'></small><noframes id='U9tAt'>

                <tbody id='U9tAt'></tbody>

                  <i id='U9tAt'><tr id='U9tAt'><dt id='U9tAt'><q id='U9tAt'><span id='U9tAt'><b id='U9tAt'><form id='U9tAt'><ins id='U9tAt'></ins><ul id='U9tAt'></ul><sub id='U9tAt'></sub></form><legend id='U9tAt'></legend><bdo id='U9tAt'><pre id='U9tAt'><center id='U9tAt'></center></pre></bdo></b><th id='U9tAt'></th></span></q></dt></tr></i><div id='U9tAt'><tfoot id='U9tAt'></tfoot><dl id='U9tAt'><fieldset id='U9tAt'></fieldset></dl></div>
                  本文介绍了在 C# 中隐藏 Vista/Win 7 上的 Start Orb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 Vista 和 Windows 7 上隐藏任务栏时,开始按钮(也称为 Start Orb)不会被隐藏.我一直在寻找解决方案,我找到了一个,但它似乎比必要的复杂.这篇 CodeProject 文章 描述了(并包含代码)您枚举所有子项的解决方案包含开始菜单的进程中所有线程的窗口.

                  When hiding the Task Bar on Vista and Windows 7 the Start Button (also known as the Start Orb) doesn't get hidden. I've been looking for a solution to this and I've found one but it seems more complex than necessary. This CodeProject article describes (and contains code for) a solution where you enumerate all child windows of all threads in the process that contains the start menu.

                  有没有人找到更简单的解决方案?

                  Has anyone found a simpler solution?

                  仅供参考.隐藏任务栏(不隐藏球体)的代码如下.首先进行必要的 Win32 导入和声明.

                  Just for reference. The code for hiding the Task Bar (without hiding the Orb) is as follows. First do the necessary Win32 imports and declarations.

                  [DllImport("user32.dll")]
                  private static extern IntPtr FindWindow(string className, string windowText);
                  
                  [DllImport("user32.dll")]
                  private static extern int ShowWindow(IntPtr hwnd, int command);
                  
                  
                  private const int SW_HIDE = 0;
                  private const int SW_SHOW = 1;
                  

                  然后,在某个方法中,使用正确的参数调用它们

                  Then, in a method somewhere, call them with the right arguments

                  IntPtr hwndTaskBar = FindWindow("Shell_TrayWnd", "");
                  ShowWindow(this.hwndTaskBar, SW_HIDE);
                  

                  推荐答案

                  我能够组合出一个不需要所有线程枚举的解决方案.以下是相关部分.

                  I was able to put together a solution that didn't require all the thread enumeration. Here are the relevant parts.

                  如果你声明 FindWindowEx 如下

                  [DllImport("user32.dll")]
                  private static extern IntPtr FindWindowEx(
                         IntPtr parentHwnd,
                         IntPtr childAfterHwnd,
                         IntPtr className,
                         string windowText);
                  

                  然后您可以像这样访问 Start Orb 的窗口句柄:

                  You can then access the window handle for the Start Orb like this:

                  IntPtr hwndOrb = FindWindowEx(IntPtr.Zero, IntPtr.Zero, (IntPtr)0xC017, null);
                  

                  并像这样禁用 Start Orb:

                  and disable the Start Orb like this:

                  ShowWindow(hwndOrb, SW_HIDE);
                  

                  这个方法的关键是我们使用 IntPtr 类型作为 className 变量,而不是 FindWindowEx 函数中的字符串.这允许我们使用这个函数的一部分,它采用 ATOM 类型而不是 string.我能够从这篇文章中看出要使用的特定 ATOM 位于 0xC017 处:隐藏 Vista Start Orb

                  The key to this method is that we use the IntPtr type for the className variable instead of a string in the FindWindowEx function. This allows us to use the portion of this function that takes an ATOM type rather than a string. I was able to discern that the particular ATOM to use is at 0xC017 from this post: Hide Vista Start Orb

                  希望这个简化的版本可以帮助一些人.

                  Hope this simplified version helps some people.

                  更新:我创建了这个新的代码项目页面来记录这个过程.

                  UPDATE: I created this new Code Project Page to document this process.

                  这篇关于在 C# 中隐藏 Vista/Win 7 上的 Start Orb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:适用于 Windows 7.0 的蓝牙低功耗 API 下一篇:有没有办法以编程方式判断系统是否启用了触摸?

                  相关文章

                    <tfoot id='uCclt'></tfoot>
                    • <bdo id='uCclt'></bdo><ul id='uCclt'></ul>
                    <legend id='uCclt'><style id='uCclt'><dir id='uCclt'><q id='uCclt'></q></dir></style></legend>
                  1. <small id='uCclt'></small><noframes id='uCclt'>

                      <i id='uCclt'><tr id='uCclt'><dt id='uCclt'><q id='uCclt'><span id='uCclt'><b id='uCclt'><form id='uCclt'><ins id='uCclt'></ins><ul id='uCclt'></ul><sub id='uCclt'></sub></form><legend id='uCclt'></legend><bdo id='uCclt'><pre id='uCclt'><center id='uCclt'></center></pre></bdo></b><th id='uCclt'></th></span></q></dt></tr></i><div id='uCclt'><tfoot id='uCclt'></tfoot><dl id='uCclt'><fieldset id='uCclt'></fieldset></dl></div>