<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script> <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>CoordMode</h1> <p>为多个命令设置坐标模式, 相对于活动窗口还是屏幕.</p> <pre class="Syntax"><span class="func">CoordMode</span>, TargetType <span class="optional">, RelativeTo</span></pre> <h2 id="Parameters">参数</h2> <dl> <dt>TargetType</dt> <dd> <p>要作用的目标类型. 指定以下单词之一:</p> <p><strong>ToolTip</strong>: 作用于 <a href="ToolTip.htm">ToolTip</a>.</p> <p><strong>Pixel</strong>: 作用于 <a href="PixelGetColor.htm">PixelGetColor</a>, <a href="PixelSearch.htm">PixelSearch</a> 和 <a href="ImageSearch.htm">ImageSearch</a>.</p> <p><strong>Mouse</strong>: 作用于 <a href="MouseGetPos.htm">MouseGetPos</a>, <a href="Click.htm">Click</a> 以及 <a href="MouseMove.htm">MouseMove</a>/<a href="MouseClick.htm">Click</a>/<a href="MouseClickDrag.htm">Drag</a>.</p> <p><strong>Caret</strong>: 作用于内置变量 <a href="../Variables.htm#Caret">A_CaretX</a> 和 <a href="../Variables.htm#Caret">A_CaretY</a>.</p> <p><strong>Menu</strong>: 作用于为 <a href="Menu.htm#Show">Menu Show</a> 命令指定坐标的时候.</p> </dd> <dt>RelativeTo</dt> <dd> <p><em>TargetType</em> 要关联的区域. 指定下列单词之一(如果省略, 则默认为 Screen):</p> <p><strong>Screen</strong>: 坐标相对于桌面(整个屏幕).</p> <p><strong>Relative</strong>: 坐标相对于活动窗口.</p> <p><strong>Window</strong> <span class="ver">[v1.1.05+]</span>: 与 <em>Relative</em> 效果相同, 但由于含义清晰, 因此建议使用.</p> <p><strong>Client</strong> <span class="ver">[v1.1.05+]</span>: 坐标相对于活动窗口的工作区, 其中不包括标题栏, 菜单栏(如果它含有标准菜单栏) 和边框. Client 坐标模式较少依赖于操作系统版本和主题.</p> </dd> </dl> <h2 id="Remarks">备注</h2> <p>如果没有使用此命令, 除了另外注明的那些外的所有命令(例如 <a href="WinMove.htm">WinMove</a> 和 <a href="InputBox.htm">InputBox</a>) 都使用相对于活动窗口的坐标模式.</p> <p>每个新运行的<a href="../misc/Threads.htm">线程</a>(例如 <a href="../Hotkeys.htm">热键</a>, <a href="Menu.htm">自定义菜单项</a>或<a href="SetTimer.htm">定时</a>子程序) 都会以此命令的默认设置开始. 通过在脚本的自动执行段(脚本的顶部) 使用此命令可以改变这个默认设置.</p> <p><span class="ver">[v1.1.23+]:</span> 内置的 <a href="../Variables.htm#CoordMode">A_CoordMode 变量</a>包含当前的设定.</p> <h2 id="Related">相关</h2> <p><a href="Click.htm">Click</a>, <a href="MouseMove.htm">MouseMove</a>, <a href="MouseClick.htm">MouseClick</a>, <a href="MouseClickDrag.htm">MouseClickDrag</a>, <a href="MouseGetPos.htm">MouseGetPos</a>, <a href="PixelGetColor.htm">PixelGetColor</a>, <a href="PixelSearch.htm">PixelSearch</a>, <a href="ToolTip.htm">ToolTip</a>, <a href="Menu.htm">Menu</a></p> <h2 id="Examples">示例</h2> <div class="ex" id="ExToolTipScreen"> <p><a class="ex_number" href="#ExToolTipScreen"></a> 把 ToolTip 放置在绝对的屏幕坐标上.</p> <pre>CoordMode, ToolTip, Screen</pre> </div> <div class="ex" id="ExToolTip"> <p><a class="ex_number" href="#ExToolTip"></a> 和上面一样的效果, 因为 "Screen" 是默认的.</p> <pre>CoordMode, ToolTip</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":"92c2ea40cfa7f153","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>