Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse problem

Status
Not open for further replies.

quebasic2

Programmer
Dec 17, 2002
174
IN
I used qbasic mouse routines in my program. As I made changes to the screen, I use inregs.ax = 2 to hide the mouse and then I used inregs.ax = 1 to show the mouse when I was through. It works fine on my windows 98 system, but on windows 2000, it leaves a picture of the mouse where I click It does not however, erase the screen. I cannot post code, because it would be pages long to show you everything. Do you know why I have this problem?
 
Here's a suggestion (more like a quick fix):

use "MOVE MOUSE" (ax=4) to move to bottom corner then apply "HIDE MOUSE" (a=2).
 
Sorry, should have said workaround instead of fix.
 
It was an exe file. It might help if I would compile the program on the win 2k computer.
 
The problem may lie in how u use the routines. If u are making something like a gui then u must follow the steps:
1. Hide the mouse pointer(Service 2)
2. Make the required graphical changes on the screen
3. Show the mouse pointer(Service 1)
 
Can you post your actual Mouse routines?

Also do you have the mouse Hex data entered correctly:
55 89 E5 8B 5E 0C 8B 07 50 8B 5E 0A 8B 07 50 8B
5E 08 8B 0F 8B 5E 06 8B 17 5B 58 1E 07 CD 33 53
8B 5E 0C 89 07 58 8B 5E 0A 89 07 8B 5E 08 89 0F
8B 5E 06 89 17 5D CA 08 00


And the function similar to this:

* MOUSE$ is the string containing the hex data in ascii format

Code:
Sub MSDRIVER(AX, BX, CX, DX)
  DEF SEG = VARSEG(MOUSE$)
  MOUSE% = SADD(MOUSE$)
  Call ABSOLUTE(AX, BX, CX, DX, MOUSE%)
End Sub

Sub MSHIDE()
  AX = 2
  MSDRIVER AX, 0, 0, 0
End Sub

Function MSINIT()
  AX = 0
  MSDRIVER AX, 0, 0, 0
  MSINIT = AX
End Function

Sub MSPUT(X, Y)
  AX = 4
  CX = X
  DX = Y
  MSDRIVER AX, 0, CX, DX
End Sub


Sub MSRANGE(X1, Y1, X2, Y2)
  AX = 7
  CX = X1
  DX = X2
  MSDRIVER AX, 0, CX, DX
  AX = 8
  CX = Y1
  DX = Y2
  MSDRIVER AX, 0, CX, DX
End Sub

Sub MSSHOW()
  AX = 1
  MSDRIVER AX, 0, 0, 0
End Sub

Sub MSSTATUS(X, Y, B1, B2, B3)
  AX = 3
  MSDRIVER AX, BX, CX, DX
  B1 = ((BX And 1) <> 0)
  B2 = ((BX And 2) <> 0)
  B3 = ((BX And 4) <> 0)
  X = CX \ 2
  Y = DX
End Sub

You say it works on 95/98 so my only suggestion is to check your code with mine above and make sure they are similar...

It works on my Win 95/98/NT/and XP machines... I don't have win 2000

Good Luck,
-Josh

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
I am using qbasic's built in mouse functions. Here is the code:

SUB mouse
CALL Interrupt(&H33, inregs, outregs)
END SUB
 
OK... Never mind...
So you are by passing the Assembly methods eh...

Just in case you are interested, here is a source dump of the hex code above... (it is in ASM)

Code:
PUSH   BP
MOV    BP,SP
MOV    BX,[BP+0C]
MOV    AX,[BX]
PUSH   AX
MOV    BX,[BP+0A]
MOV    AX,[BX]
PUSH   AX
MOV    BX,[BP+08]
MOV    CX,[BX]
MOV    BX,[BP+06]
MOV    DX,[BX]
POP    BX
POP    AX
PUSH   DS
POP    ES
Code:
INT    33
Code:
PUSH   BX
MOV    BX,[BP+0C]
MOV    [BX],AX
POP    AX
MOV    BX,[BP+0A]
MOV    [BX],AX
MOV    BX,[BP+08]
MOV    [BX],CX
MOV    BX,[BP+06]
MOV    [BX],DX
POP    BP
RETF   0008

When called with Call Absolute, as shown here:

Code:
Sub MSDRIVER(AX, BX, CX, DX)
  DEF SEG = VARSEG(MOUSE$)
  MOUSE% = SADD(MOUSE$)
  Call ABSOLUTE(AX, BX, CX, DX, MOUSE%)
End Sub

Sub MSHIDE()
  AX = 2
  MSDRIVER AX, 0, 0, 0
End Sub

It looks like it takes the params &quot;AX,BX,CX,DX&quot; and puts them into the registers AX,BX,CX,DX then executes Int 33 then puts the registers back into the params...

which looks, basicly, like what you are doing...

if all else fails... you might want to give this method a try...

Good Luck

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
Yeah thanks. Would not asm be less compatible then qbasics mouse routine? I have 7.1.
 
I NEVER HAD MUCH LUCK WITH 7.1,
YOU MIGHT WANT TO TRY THE SAME PROGRAM WITH 4.5 AND SEE WHAT RESULTS YOU CAN GET...

7.1 SEEMS TO BE VERY BUGGY...

IF YOU DON'T HAVE 4.5, YOU CAN LOOK FOR IT @
SHOULD BE UNDER COMPILERS...

also, QBasic is Naturally Slow... Due to the fact that it is based off of an interpreted language...

Assembly code runs the fastest...

when you use CALL ABSOLUTE, it switches control to the Assembly commands while the function executes...

This &quot;should&quot; be the faster method, in theory...

In the end, use what ever works...

Let me know if you get the CALL INTERUPT to work with the mouse...

also there are other compatibility issues...

CALL INTERUPT is supported w/ QBasic (free interpreter) and QuickBasic (compiler)

...where CALL INTERUPT is only supported in QuickBasic

Good Luck

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
4.5 and 7.1 run the code fine on my computer, but if I compile the code and run it on a windows 2000 system I have the problem. I do not have trouble running it on my system however.
 
Call Interrupt is NOT supported on Qbasic though Call Absolute is.

Call Interrupt and Call Absolute are supported under QuickBasic from at least versions 4.0 and up with the use
of a library (such as the default QB.QLB or QBX.QLB) that includes it.
 
>>>>Call Interrupt is NOT supported on Qbasic though Call Absolute is.

>>Call Interrupt and Call Absolute are supported under
>>QuickBasic from at least versions 4.0 and up with the use
>>of a library (such as the default QB.QLB or QBX.QLB) that
>>includes it.

I was refering to QBasic as the interpreter that ships w/ dos and some windows versions...

NOT QUICKBAIC

I know quickbasic supports them via libraries...

QBasic does not support libaries...

It does support Call Absolute...

It does NOT support Call Interupt...

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top