/docs/commands/WinSetTitle.htm
http://autohotkey-chinese.googlecode.com/ · HTML · 56 lines · 50 code · 6 blank · 0 comment · 0 complexity · 60d1cfc6d805ce6ef29ecc33e6cf3a38 MD5 · raw file
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <title>WinSetTitle</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link href="../css/commands.css" rel="stylesheet" type="text/css">
- <link href="../css/print.css" rel="stylesheet" type="text/css" media="print">
- </head>
- <body>
-
- <h1>WinSetTitle</h1>
-
- <p>改变匹配指定条件的窗口的标题。</p>
-
- <p class="CommandSyntax">WinSetTitle, NewTitle<br>
- WinSetTitle, WinTitle, WinText, NewTitle [, ExcludeTitle, ExcludeText] </p>
- <h3>参数 </h3>
- <table border="1" width="100%" cellspacing="0" cellpadding="3" bordercolor="#C0C0C0">
- <tr>
- <td width="15%">NewTitle</td>
- <td width="85%">目标窗口的新标题。如果只指定这一个参数,其它参数省略,默认目标是 <a href="../LastFoundWindow.htm">上一次匹配窗口</a> 。</td>
- </tr>
- <tr>
- <td>WinTitle</td>
- <td>目标窗口的标题或标题中的部分文字(匹配模式由 <a href="SetTitleMatchMode.htm">SetTitleMatchMode</a> 决定)。如果省略其它 3 个参数,默认目标是 <a href="../LastFoundWindow.htm">上一次匹配窗口</a> 。如果这个参数使用字母 A ,同时省略其它 3 个参数,则以当前激活的窗口作为目标。要用窗口的 class 名进行匹配,使用 <em>ahk_class 精确 class 名</em>(Window Spy 中可以显示 class 名)。要用窗口的 <a href="Process.htm">进程标识符(PID)</a>进行匹配,使用 <em>ahk_pid %PID变量%</em> 。要用 <a href="GroupAdd.htm">窗口组</a> ,使用 <em>ahk_group 组名</em> 。要用窗口的 <a href="WinGet.htm">唯一 ID</a> 进行匹配,使用 <em>ahk_id %ID变量%</em> 。要减小检测范围,使用 <a href="../LastFoundWindow.htm#multi">多重条件</a> ,例如:<em>My File.txt ahk_class Notepad</em></td>
- </tr>
- <tr>
- <td>WinText</td>
- <td>如果使用这个参数,则它应该是目标窗口中某个文本元素的子字符串(在 Window Spy 中会显示出窗口中的文本元素)。隐藏文本只有在 <a href="DetectHiddenText.htm">DetectHiddenText</a> 设置为 ON 的时候才能检测到。</td>
- </tr>
- <tr>
- <td>ExcludeTitle</td>
- <td>标题中包含该参数指定的文字的窗口将被除外。</td>
- </tr>
- <tr>
- <td>ExcludeText</td>
- <td>文本元素中包含该参数指定的文字的窗口将被除外。</td>
- </tr>
- </table>
-
- <h3>注意</h3>
- <p>如果窗口所在的程序本身经常修改窗口的标题,那么该命令对窗口标题的修改就只能是暂时的。</p>
- <p>窗口的标题和窗口中的文字是大小写敏感的。要检测隐藏窗口,必须打开 <a href="DetectHiddenWindows.htm">DetectHiddenWindows</a> 。</p>
- <h3>相关命令</h3>
- <p><a href="WinMove.htm">WinMove</a>, <a href="WinGetActiveStats.htm">WinGetActiveStats</a>, <a href="WinGetActiveTitle.htm">WinGetActiveTitle</a>, <a href="WinGetText.htm">WinGetText</a>, <a href="ControlGetText.htm">ControlGetText</a>, <a href="WinGetPos.htm">WinGetPos</a>, <a href="WinSet.htm">WinSet</a></p>
- <h3>示例</h3>
- <pre class="NoIndent">WinSetTitle, Untitled - Notepad, , This is a new title
-
- <em>; 另一个修改记事本标题的例子:</em>
- Run, notepad.exe
- WinWaitActive, Untitled - Notepad
- WinSetTitle, This is a new title <em>; 使用上面 WinWaitActive 找到的窗口</em></pre>
-
- </body>
- </html>