<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1632085368384154" crossorigin="anonymous"></script><script src="https://autohotkey.top/gtag.js"></script></head> <body> <h1>WinGetTransparent</h1> <p>返回指定窗口的透明度的等级.</p> <pre class="Syntax">Transparent := <span class="func">WinGetTransparent</span>(<span class="optional">WinTitle, WinText, ExcludeTitle, ExcludeText</span>)</pre> <h2 id="Parameters">参数</h2> <dl> <dt>WinTitle, WinText, ExcludeTitle, ExcludeText</dt> <dd> <p>类型: <a href="../Concepts.htm#strings">字符串</a>, <a href="../Concepts.htm#numbers">整数</a>或<a href="../Objects.htm">对象</a></p> <p>如果这些都未设置或省略, 将使用<a href="../misc/WinTitle.htm#LastFoundWindow">上次找到的窗口</a>. 否则, 为 <em>WinTitle</em> 指定<a href="../misc/WinTitle.htm">窗口标题或其他条件</a>, 来标识目标窗口, 和/或为 <em>WinText</em> 指定目标窗口的单个文本元素的子字符串(由包含的 Window Spy 实用程序显示). 如果 <a href="DetectHiddenText.htm">DetectHiddenText</a> 已经打开, 则检测隐藏文本元素. 标题或文本包含 <em>ExcludeTitle</em> 或 <em>ExcludeText</em> 的窗口将不被考虑.</p> </dd> </dl> <h2 id="Return_Value">返回值</h2> <p>类型: <a href="../Concepts.htm#numbers">整数</a>或<a href="../Concepts.htm#nothing">字符串(空)</a></p> <p>返回值是一个空字符串, 如果窗口没有设置透明度等级, 或其他情况(由操作系统行为引起) 例如设置透明后窗口被最小化, 还原和/或重设大小.</p> <p>否则, 返回值是一个 0 到 255 之间的整数, 其代表了指定窗口的透明度等级, 其中 0 表示不可见窗口, 而 255 表示不透明窗口(有关如何设置透明度, 请参阅 <a href="WinSetTransparent.htm">WinSetTransparent</a>).</p> <h2 id="Error_Handling">错误处理</h2> <p>如果找不到窗口, 则抛出 <a href="Error.htm#TargetError">TargetError</a>.</p> <h2 id="Remarks">备注</h2> <p>鼠标光标下的窗口的 ID 可以使用 <a href="MouseGetPos.htm">MouseGetPos</a> 来获取.</p> <p>窗口标题和文本是区分大小写的. 除非 <a href="DetectHiddenWindows.htm">DetectHiddenWindows</a> 被打开, 否则不会检测隐藏窗口.</p> <h2 id="Related">相关</h2> <p><a href="WinSetTransparent.htm">WinSetTransparent</a>, <a href="WinGetTransColor.htm">WinGetTransColor</a>, <a href="Win.htm">窗口函数</a>, <a href="Control.htm">控件函数</a></p> <h2 id="Examples">示例</h2> <div class="ex" id="ExBasic"> <p><a class="ex_number" href="#ExBasic"></a> 检索鼠标指针下窗口的透明度.</p> <pre>MouseGetPos ,, &amp;MouseWin Transparent := WinGetTransparent(MouseWin)</pre> </div> <a href="https://dftg.net">dftg</a><!-- Cloudflare Pages Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "d5a9c4fcb9b6482fa53ce820d892f969"}'></script><!-- Cloudflare Pages Analytics --><script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon='{"rayId":"92d4fceb1a37eac7","version":"2025.3.0","r":1,"serverTiming":{"name":{"cfExtPri":true,"cfL4":true,"cfSpeedBrain":true,"cfCacheStatus":true}},"token":"51750bb5dc4f40cc91a5ec55c63bbc01","b":1}' crossorigin="anonymous"></script> </body> </html>