SetMouseRange(LPRECT lpRect) // Dat vung di chuyen cho chuot { _AX = 0x07;//ham 07 cua ngat 33 de dinh gioi han di chuyen ngang _CX = lpRect-left; _DX = lpRect-right; geninterrupt(INT_MOUSE);//INT_MOUSE=0x33:ngat 33 _AX = 0x08;//ham 08 cua ngat 33 dinh gioi han di chuyen doc cho con tro | 78 extern int GetMtx extern int GetMty extern EVENT OldEvent extern int Double LPEVENT endif End of include include include include include void SetMouseRange LPRECT lpRect Dat vung di chuyen cho chuot _AX 0x07 ham 07 cua ngat 33 de dinh gioi han di chuyen ngang _CX lpRect- left _DX lpRect- right geninterrupt INT_MOUSE INT_MOUSE 0x33 ngat 33 _AX 0x08 ham 08 cua ngat 33 dinh gioi han di chuyen doc cho con tro _CX lpRect- top _DX lpRect- bottom geninterrupt INT_MOUSE ----------------------------------------------------------- int InitMouse LPRECT lpRect Khoi dong chuot int ax _AX 0 geninterrupt INT_MOUSE ax _AX if ax 0 return FALSE SetMouseRange lpRect return TRUE ----------------------------------------------------------- void ShowMouse void Hien thi chuot _AX 1 geninterrupt INT_MOUSE ----------------------------------------------------------- void HideMouse void Dau chuot _AX 2 geninterrupt INT_MOUSE ----------------------------------------------------------- include include void MouseRead LPEVENT lpEvent Tra ve bien co nhan duoc tu chuot Nut trai hay phai duoc an 79 int bx _AX 3 geninterrupt INT_MOUSE bx _BX cx _CX dx _DX lpEvent- Msg bx lpEvent- Posx _CX lpEvent- Posy _DX gettime lpEvent- t ----------------------------------------------------------- void ResetEvent LPEVENT lpEvent lpEvent- Msg 0 lpEvent- Posx lpEvent- Posy 0 ----------------------------------------------------------- EVENT PrevEvent CurEvent ----------------------------------------------------------- LPEVENT GetEvent void ResetEvent CurEvent MouseRead CurEvent chuyen sang toa do ViewPort xet trang thai chuot co thay doi hay khong if M_CHANGE PrevEvent CurEvent delay 50 return CurEvent .