Meine if
Anweisung auf Zeile 8 funktioniert nicht. Obwohl die Msgbox
von% Width% 3200 anzeigt, erhalte ich immer die "Breite ist nicht 3200" -Mailbox. Wenn Sie if
in == ändern und die Überprüfung auf "3200" anstelle von 3200 setzen, hat dies keine Auswirkungen.Autohotkey if-Anweisung funktioniert nicht
Ich habe auch die if
Anweisung innerhalb der activeMonitorInfo
Methode und es zeigt das gleiche Verhalten in dort.
#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
}
}
}
Danke, ich bin ein Clown :) – RichardB