0
私のif
行8の文が機能しません。 %Width%のMsgbox
が3200を示しても、私は常に「幅は3200ではありません」というメッセージボックスを表示します。 if
を==に変更し、3200ではなく「3200」をチェックすることは効果がありません。Autohotkey if文が機能していない
また、if
の文をactiveMonitorInfo
メソッドの中に入れました。これは同じ動作を示しています。
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
activeMonitorInfo(X, Y, Width, Height)
Msgbox %Width%
if (%Width% = 3200) {
msgbox "Width is 3200"
return
} else {
msgbox "Width is not 3200"
return
}
activeMonitorInfo(ByRef X, ByRef Y, ByRef Width, ByRef Height)
{
CoordMode, Mouse, Screen
MouseGetPos, mouseX , mouseY
SysGet, monCount, MonitorCount
Loop %monCount%
{
SysGet, curMon, Monitor, %a_index%
if (mouseX >= curMonLeft and mouseX <= curMonRight and mouseY >= curMonTop and mouseY <= curMonBottom) {
X := curMonTop
y := curMonLeft
Height := curMonBottom - curMonTop
Width := curMonRight - curMonLeft
return
}
}
}
ありがとうございます、私はピエロです:) – RichardB