Using a mouse in basic appears to be one of the hottest topics here. In QuickBasic 4.5 and PDS 7.1 a relatively simple interrupt call is needed and I have included a program modified from one in Microsofts' knowledge base on one way to do it. Another approach is to be found in Winers excellent text, available from the Basic Home page. For QBASIC 1.0 (the one that comes free with dos 5.0 and up) you have to emulate an interrupt, code for this and some example mouse code can be found in Douggie Greens Basic FAQ (obtainable from the email address below, or the Basic home page. FAQ Email: basicfaq@blissinx.demon.co.uk, with send-me-new-code-faq in the subject line. Basic Home Page,http://www.fys.ruu.nl/~bergmann/basic.html Other information sources: "Advanced MS-DOS Programming," Second Edition, by Ray Duncan (Microsoft Press, 1988) Pages 593-611. (The first edition published in 1986 did not document the mouse interrupt.) For more information regarding making mouse calls from BASIC, see the "Microsoft Mouse Programmer's Reference Guide," . Microsoft Knowlege Base DOCUMENT:Q37882 12-JAN-1990 [B_QUICKBAS] TITLE :Call Microsoft MOUSE from QB 4.x Using Assembler, INTERRUPT PRODUCT :Microsoft QuickBASIC Compiler PROD/VER:4.00 4.00b 4.50 OPER/SYS:MS-DOS KEYWORDS:B_BasicCom '--- Begin mousie.bas ---------------------- ' modifed from code found in Microsoft Knowledge Base DEFINT A-Z '$INCLUDE: 'qb.bi' ' Note: include QBX.BI for BASIC PDS 7.00 '===================================================================== ' Mouse Library Routine Declarations '===================================================================== DECLARE SUB MouseHandler (M0%, M1%, M2%, M3%) DECLARE SUB MouseOff () DECLARE SUB MouseOn () DECLARE SUB MousePointerOff () DECLARE SUB MousePointerOn () DECLARE SUB GetMXY (mx%, my%) DECLARE SUB MouseGetStatus (Lb%, Rb%, Cb%, Row%, Column%) DECLARE SUB MouseSetPointer (Row%, Column%) DECLARE SUB MouseSetWindow (TopRow%, LeftColumn%, BottomRow%, RightColumn%) DECLARE FUNCTION MBtn% () DECLARE FUNCTION MouseInstalled% () DECLARE FUNCTION MouseReset% () CLS Mouse = MouseInstalled% IF Mouse THEN Button = MouseReset% MousePointerOn PRINT Button END IF Count = 0 DO 'CALL MousePointerOn CALL MouseGetStatus(Lb%, Rb%, Cb%, Row%, Column%) LOCATE 10, 10: PRINT Lb%, Rb%, Row%, Column%, Count IF Lb% THEN Count = Count + 1 ELSEIF Rb% THEN EXIT DO ELSE Count = 0 END IF LOOP UNTIL LEN(INKEY$) CALL MouseOn CALL MouseSetPointer(11, 5) CALL MouseSetWindow(15, 25, 20, 30) DO CALL MouseGetStatus(Lb%, Rb%, Cb%, Row%, Column%) LOCATE 10, 10: PRINT Lb%, Rb%, Row%, Column%, Count IF Lb% THEN Count = Count + 1 ELSEIF Rb% THEN Count = Count + 1 IF Count = 1 THEN EXIT DO END IF ELSE Count = 0 END IF LOOP UNTIL LEN(INKEY$) CALL MouseOff '------- Get Text Mode coordinates -------- SUB GetMXY (x, y) STATIC MouseHandler 3, 0, x, y 'get GRAPHIC coordinates x = (x / 8) + 1 'convert to TEXT coordinates y = (y / 8) + 1 END SUB '------- Return Button Status ------- FUNCTION MBtn% STATIC MouseHandler 3, Buttons, 0, 0 MBtn% = Buttons END FUNCTION SUB MouseGetStatus (Lb%, Rb%, Cb%, x, y) STATIC ButtonInfo = 3 Button = 0 MouseHandler ButtonInfo, Button, y, x 'get GRAPHIC coordinates SELECT CASE Button CASE 0 Lb% = 0 Rb% = 0 Cb% = 0 CASE 1 Lb% = 1 Rb% = 0 CASE 2 Lb% = 0 Rb% = 2 CASE 3 Cb% = 3 END SELECT x = (x / 8) + 1 'convert to TEXT coordinates y = (y / 8) + 1 END SUB '------- Mouse Interrupt ------ SUB MouseHandler (M0%, M1%, M2%, M3%) STATIC DIM InRegs AS RegType, OutRegs AS RegType InRegs.ax = M0% InRegs.BX = M1% InRegs.CX = M2% InRegs.DX = M3% CALL Interrupt(51, InRegs, OutRegs) M0% = OutRegs.ax M1% = OutRegs.BX M2% = OutRegs.CX M3% = OutRegs.DX END SUB '------- Mouse Driver Active -------- FUNCTION MouseInstalled% STATIC DEF SEG = 0 mseg% = 256 * PEEK(51 * 4 + 3) + PEEK(51 * 4 + 2) moff% = 256 * PEEK(51 * 4 + 1) + PEEK(51 * 4) IF mseg% OR moff% THEN DEF SEG = mseg% IF PEEK(moff%) = 207 THEN MouseInstalled% = 0 ELSE MouseInstalled% = -1 END IF ELSE MouseInstalled% = 0 END IF DEF SEG END FUNCTION '------- Turn Mouse Off ------- SUB MouseOff STATIC MouseHandler 0, 0, 0, 0 END SUB '------- Turn Mouse On -------- SUB MouseOn STATIC MouseHandler 0, 0, 0, 0 'initialize mouse driver MouseHandler 1, 0, 0, 0 'turn mouse cursor on END SUB '------- Hide the Mouse Cursor ------- SUB MousePointerOff STATIC CALL MouseHandler(2, 0, 0, 0) END SUB '------ Draw Mouse Cursor ------- SUB MousePointerOn STATIC MouseHandler 1, 0, 0, 0 END SUB FUNCTION MouseReset% STATIC Present = 0 Button = 0 MouseHandler Present, Button, 0, 0 IF Present THEN MouseReset% = Button ELSE MouseReset = 0 END FUNCTION '------- Set Mouse Coordinates -------- SUB MouseSetPointer (y, x) STATIC MouseHandler 4, 0, (x - 1) * 8, (y - 1) * 8 END SUB '------- Set Horizontal Minimum/Maximum ----- '------- Set Vertical Minimum/Maximum ------- SUB MouseSetWindow (y, x, v, h) STATIC MouseHandler 7, 0, (x - 1) * 8, (h - 1) * 8 MouseHandler 8, 9, (y - 1) * 8, (v - 1) * 8 END SUB