DEM пишет:Почему то выдает ошибку...
Ну правильно, зачем два скрипта совмещать? Вот ещё пример вычисления координат:
CoordMode, Mouse
SetFormat, FloatFast, 0
PartOfWidth := A_ScreenWidth/8
PartOfHeight := A_ScreenHeight/8
RightBorderOfWidth := A_ScreenWidth - PartOfWidth
DownBorderOfHeight := A_ScreenHeight - PartOfHeight
MsgBox,,, % "текущее разрашение: "A_ScreenWidth " на "A_ScreenHeight, 1
MsgBox,,, % "размер части ширины экрана, ширина гъюи: "PartOfWidth
. "`nразмер части высоты экрана, высота гъюи: "PartOfHeight, 1
MsgBox,,, % "правая граница ширины экрана: "RightBorderOfWidth
. "`nнижняя граница высоты экрана: "DownBorderOfHeight, 1
Loop, 5
{
RevealGUI()
Sleep, 250
Gui, Destroy
Sleep, 250
}
RevealGUI()
SetTimer, ChaseCoordinates, 100
Return
RevealGUI()
{
global
Gui, Color, Red
Gui, -Caption +ToolWindow +LastFound +AlwaysOnTop +Border
Gui, Show, NoActivate x%RightBorderOfWidth% y%DownBorderOfHeight%
Gui, Show, w%PartOfWidth% h%PartOfHeight%
}
ChaseCoordinates:
MouseGetPos, x_pos, y_pos
ToolTip, % "текущие координаты: "x_pos ", "y_pos
Return
LButton::
If (x_pos >= RightBorderOfWidth && y_pos >= DownBorderOfHeight)
MsgBox, 64,, % "клик в районе заданой части ширины/высоты экрана"
. "`nx: "x_pos " ("RightBorderOfWidth ") "
. "`ny: "y_pos " ("DownBorderOfHeight ")", 1
Else
MsgBox, 48,, % "клик вне заданой части ширины/высоты экрана"
. "`nx: "x_pos " ("RightBorderOfWidth ") "
. "`ny: "y_pos " ("DownBorderOfHeight ")", 1
Return
Esc::ExitApp