ll_libload user, "user32.dll"
ll_getproc ClipCursor, "ClipCursor", user
ll_getproc GetClipCursor, "GetClipCursor", user
#module
#deffunc mousearea val
mref area, 48
mref stt, 64
ll_getptr area : ll_ret rect
ll_callfunc rect, 1, GetClipCursor@ : ll_ret prm : stt = prm
return
#deffunc mousebind int, int, int, int
mref left, 0 : mref top, 1 : mref right, 2 : mref bottom, 3
i = left, top, right, bottom
if i.0 ! 0 | (i.1 ! 0) | (i.2 ! 0) | (i.3 ! 0) {
ll_getptr i
ll_ret rect
} else {
rect = 0
}
ll_callfunc rect, 1, ClipCursor@
return
#global
sdim msg, 10, 2
msg = "制限する", "解除する"
area = 100, 100, 500, 400
dim chk, 4
bgscr 2, dispx, dispy, , 0, 0
objsize 80, 20
pos 150, 150 : button msg.0, *binding
pos 150, 180 : button "終了", *exit
onexit *exit
*binding
bflg = 1 - bflg
objprm 0, msg.bflg
mousebind bflg * area.0, bflg * area.1, bflg * area.2, bflg * area.3
mousearea chk
if stat {
redraw 0
color 255, 255, 255 : boxf
color 200, 100, 200 : boxf chk, chk.1, chk.2, chk.3
redraw 1
} else {
dialog "範囲の取得に失敗しました"
}
stop
*exit
mousebind
|