qb45
高级用户
积分 677
发帖 194
注册 2003-9-13
状态 离线
|
『楼 主』:
用QB4。5写的鼠标函数,启动时此格式 QB/L
'$INCLUDE: 'qb.bi'
Mouse.Setrage 0, 0, 640, 480
SCREEN 12
Mouse.Show
LINE (100, 100)-STEP(50, 50), 3, BF
DO
k$ = INKEY$
IF k$ = chr$(27) THEN EXIT DO
IF Mouse.down(2) THEN PRINT "right key"
DO WHILE Mouse.InBox(100, 100, 50, 50)
IF Mouse.down(1) THEN
PRINT "ok"
end
END IF
LOOP
LOOP
SUB Mouse (m1%, m2%, m3%, m4%)
DIM inreg AS RegType, outreg AS RegType
inreg.ax = m1%
inreg.bx = m2%
inreg.cx = m3%
inreg.dx = m4%
INTERRUPT &H33, inreg, outreg
m1% = outreg.ax
m2% = outreg.bx
m3% = outreg.cx
m4% = outreg.dx
END SUB
FUNCTION Mouse.down (button%)
Mouse 3, Mouse.button%, x%, y%
Mouse.down = 0
IF button% = 1 THEN
IF Mouse.button% = 1 THEN Mouse.down = -1
END IF
IF button% = 2 THEN
IF Mouse.button% = 2 THEN Mouse.down = -1
END IF
END FUNCTION
SUB Mouse.Hide
Mouse 2, 0, 0, 0
END SUB
FUNCTION Mouse.InBox (box.x, box.y, box.w, box.h)
box.x1 = box.x + box.w: box.y1 = box.y + box.h
Mouse.InBox = 0
IF Mouse.X > box.x AND Mouse.Y > box.y THEN
IF Mouse.X < box.x1 AND Mouse.Y < box.y1 THEN Mouse.InBox = -1
END IF
END FUNCTION
SUB Mouse.Setrage (x%, y%, W%, H%)
Mouse 7, 0, x%, x% + W%
Mouse 8, 0, y%, y% + H%
END SUB
SUB Mouse.Show
Mouse 1, 0, 0, 0
END SUB
SUB Mouse.State (x%, y%, Mouse.button%)
Mouse 3, Mouse.button%, x%, y%
END SUB
FUNCTION Mouse.X
Mouse 3, Mouse.button%, x%, y%
Mouse.X = x%
END FUNCTION
FUNCTION Mouse.Y
Mouse 3, Mouse.button%, x%, y%
Mouse.Y = y%
END FUNCTION[em09]
|
我(QB45)的照片与简历
http://www.programfan.com/club/showbbs.asp?id=197280
|
|