Function Reference

_MouseTrap

マウスカーソルを指定した座標内に閉じ込めます。

#Include <Misc.au3>
_MouseTrap([$iLeft = 0 [, $iTop = 0 [, $iRight = 0 [, $iBottom = 0]]]])

 

パラメータ

$iLeft [オプション]左側座標
$iTop [オプション]上側座標
$iRight [オプション]右側座標
$iBottom [オプション]下側座標

 

返し値

成功: True
失敗: False

 

注意

マウスカーソルを解放するためには_MouseTrap()をパラメータなしで使用してください。

 

関連

 


#include <GuiConstantsEx.au3>
#include <Misc.au3>

Opt("MustDeclareVars", 1)

_Main()

Func _Main()
    Local $GUI, $coords[4]

    $GUI = GUICreate("Mouse Trap Example", 392, 323)

    GUISetState()

    While 1
        $coords = WinGetPos($GUI)
        _MouseTrap($coords[0], $coords[1], $coords[0] + $coords[2], $coords[1] + $coords[3])
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case Else
                ;;;
        EndSwitch
    WEnd
    _MouseTrap()
    Exit
EndFunc   ;==>_Main