【发布时间】:2015-12-18 21:49:17
【问题描述】:
这是我正在尝试做的事情,非常感谢这里的任何帮助。
我正在尝试使用 Autohotkey 脚本自动最大化 Skype 中的实时对话窗口。我正在努力做到这一点,以便我可以使用 Skype 呼叫远程机器并让它自动应答(这是 Skype 中的本机)......一旦我有一个实时对话窗口,我想最大化实时对话窗口以填充屏幕。
我试了一下,但不知何故认为我没有正确的 ahk_class 用于实时对话窗口,但我可能还缺少其他东西。我在下面放置了我尝试过使用的代码......任何帮助都会很棒。
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Persistent
IfWinExist, TLiveConversationWindow ;
{
WinActivate
WinMaximize
send !{Enter};When using skype normally this Alt+Enter will maximize the window
return
}
我还尝试使用此代码来确定实时对话窗口的正确类...但到目前为止还没有帮助。
Alt & Enter::
IfWinExist, TLiveConversationWindow
WinActivate
ControlFocus, ClassNN TLiveConversation1
ControlClick, ClassNN TLiveConversation1, , , , 2,
MouseClick, left, , , 2
send !{Enter}
; now we get the ID & CLASS
WinGet, Active_Window_ID, ID, A
WinGetClass, Active_Window_Class, A
MsgBox, The active window's class is "%Active_Window_class%" and ID is %Active_Window_ID%
能够获得代码的简化版本以使用热键启动,但无法让 WinWait 函数按照@Schneyer 的方式工作。
热键激活的功能代码
#NoEnv
#Warn
#Persistent
SendMode Input
SetWorkingDir %A_ScriptDir%
; Skype Maximizer initiating functions
^!p::
;WinWait ahk_class TLiveConversation1
;WinWait ahk_class TConversationForm
;WinWait ahk_class TLiveConversationWindow
;WinMaximize ahk_class TLiveConversation1
;functioning code
;Activate tSkMainForm.
WinActivate ahk_class tSkMainForm
;Send Alt Enter Input to maximize.
SendInput !{Enter}
;TLiveConversationWindow Always On Top
WinSet, AlwaysOnTop,,ahk_class TLiveConversationWindow
;Minimize main form
WinMinimize ahk_class tSkMainForm
Return
当用任何 WinWait 函数交换 ^!p:: 时,似乎什么都没有发生。 WinWait 似乎应该是正确的方法,有什么想法为什么它不起作用?
【问题讨论】:
-
是什么不工作?你可以把问题缩小到哪一行?
-
据我所知,不工作的部分是识别 LiveConversationWindow 的正确类。我已经尝试了以下 ahk_class LiveConversationWindow ahk_class TLiveConversation1 (它显示为检查员的 ahk_class tSkMainForm 的 ClassNN)我已经使用下面@Schneyer 给出的代码完成了此操作,并在下面的评论之后显示。
标签: autohotkey skype