Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > [MSWIN32] Trouble with mouse programming

Reply
Thread Tools

[MSWIN32] Trouble with mouse programming

 
 
Nobby Golder
Guest
Posts: n/a
 
      12-23-2009
Hello friends

I am trying to run this simple test program to on my WinXP, but
every time I try to run it just crashes. I have also tested couple of
programs from Net on my machine but they also seem to fail. I reckon
that WinXP does not allow me to set up a mouse handler.


#include <stdio.h>
#include <dos.h>
#include <conio.h>


const int MOUSE_INT_MASK = 0x15;
union REGS i, o;
union SREGS sr;


void far interrupt mouse_handler()
{


printf("You did something with mouse\n");



}


int init_mouse()
{
int i;
asm {
mov ax, 0;
int 0x33;
mov i, ax

}
return i;



}


void show_mouse() {

asm {
mov ax, 0x1;
int 0x33;
}



}


void mouse_init( )
{
unsigned short seg = FP_SEG(mouse_handler);
unsigned short off = FP_OFF(mouse_handler);
/* convert the below to assembly */
i.x.ax = 0x0C;
i.x.cx = MOUSE_INT_MASK;
i.x.dx = off;
sr.es = seg;
int86x(0x33, &i, &o, &sr);


}


void main()
{
clrscr();

init_mouse();
show_mouse();
mouse_init();
while(!kbhit())
continue;
}
 
Reply With Quote
 
 
 
 
Seebs
Guest
Posts: n/a
 
      12-23-2009
On 2009-12-23, Nobby Golder <(E-Mail Removed)> wrote:
> Hello friends
>
> I am trying to run this simple test program to on my WinXP, but
> every time I try to run it just crashes. I have also tested couple of
> programs from Net on my machine but they also seem to fail. I reckon
> that WinXP does not allow me to set up a mouse handler.


That may well be. You might find a newsgroup related to Windows programming
better suited to answering your question, though, as there's nothing remotely
related to the C language here, just a bunch of questions about a particular
operating system.

-s
--
Copyright 2009, all wrongs reversed. Peter Seebach / http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      12-23-2009
Nobby Golder <(E-Mail Removed)> writes:
> I am trying to run this simple test program to on my WinXP, but
> every time I try to run it just crashes. I have also tested couple of
> programs from Net on my machine but they also seem to fail. I reckon
> that WinXP does not allow me to set up a mouse handler.

[snip]

Try asking in comp.os.ms-windows.programmer.win32.

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Kaz Kylheku
Guest
Posts: n/a
 
      12-23-2009
On 2009-12-23, Nobby Golder <(E-Mail Removed)> wrote:
> Hello friends
>
> I am trying to run this simple test program to on my WinXP, but
> every time I try to run it just crashes.


Yes it does. And you know what else? Reagan isn't U.S. President any longer.

You should try to get your life together first, before worrying about mice
under Windows.

Things changed a lot since you fell into that coma in 1986, and not only in PC
programming.
 
Reply With Quote
 
Nobody
Guest
Posts: n/a
 
      12-23-2009
On Wed, 23 Dec 2009 20:56:03 +0000, Nobby Golder wrote:

> I am trying to run this simple test program to on my WinXP, but
> every time I try to run it just crashes. I have also tested couple of
> programs from Net on my machine but they also seem to fail. I reckon
> that WinXP does not allow me to set up a mouse handler.


The code is written for DOS. It would (presumably) work on DOS, or on
the versions of Windows which run on top of DOS (Win3.1, Win95/98/ME).

It won't work on any NT-based version of Windows (NT,2K,XP,Vista,7).
These don't support real-mode 8086 code. Try DOSbox, DOSemu, etc.

Further questions should probably go to comp.os.msdos.programmer.

 
Reply With Quote
 
Beej Jorgensen
Guest
Posts: n/a
 
      12-23-2009
On 12/23/2009 12:56 PM, Nobby Golder wrote:
> I am trying to run this simple test program to on my WinXP, but
> every time I try to run it just crashes. I have also tested couple of
> programs from Net on my machine but they also seem to fail. I reckon
> that WinXP does not allow me to set up a mouse handler.


My Dearest Nobby:

Here are some answers to your exact question which appeared on Usenet
word-for-word in April 2004:

http://groups.google.com/group/comp....cdd9309f25a6b8

Merry Xmas &c.,
-Beej

 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      12-23-2009
Nobby Golder a écrit :
> Hello friends
>
> I am trying to run this simple test program to on my WinXP, but
> every time I try to run it just crashes. I have also tested couple of
> programs from Net on my machine but they also seem to fail. I reckon
> that WinXP does not allow me to set up a mouse handler.


This program is written for the MSDOS operating system,
that has ceased to exist more than 15 years ago (more or less).

That's why it doesn't work.

Try to get the documentation for windows xp, get a 32
bit compiler and use the windows API. Then you can setup
a mouse "handler" as you wish.

jacob
 
Reply With Quote
 
Richard Bos
Guest
Posts: n/a
 
      12-28-2009
Nobby Golder <(E-Mail Removed)> wrote:

It's CGRIIIISTMAAAASS!!!!

> Hello friends
>
> I am trying to run this simple test program to on my WinXP, but


> #include <dos.h>
> #include <conio.h>


It's also a particularly dumb troll.

Richard
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Screen Capture With Mouse , Mouse Position Capture Max Java 7 08-08-2009 11:51 PM
Heres a mouse theres a mouse what a mouse do? unholy Gaming 37 09-17-2006 08:59 AM
tricky+frustrating: changing mouse handler while mouse pressed doesn't work Claus Atzenbeck Java 1 11-26-2004 09:40 AM
mouse systems classic mouse drivers LJA Computer Support 9 11-16-2004 11:27 PM
ASP.Net Datagrid get Cell Contents on mouse click or mouse down Davisro ASP .Net 2 04-23-2004 07:18 PM



Advertisments