I love trying different softwares/applications which increase productivity of work and give pleasant working experience. In this blog I will share my experience with various softwares, mobile application, Tech gadgets etc..
And here you will find some tutorials for C programming, Android application Development, other tips and tricks too..!

Pages

Thursday, 21 March 2013

Mouse Programming in C

This is simple tutorial to show you How you can use Mouse in your C program.
I have Attached a source file. This program is not developed by me. I found it on internet somewhere, But as this program is easy to understand I am using this program.

You don't need to remember all this stuff. This is just for understanding.
If you have studied any Micro Controller subject then you can easily identify that these ax,bx... indicates Registers.

So, let me first tell what we exactly gonna do.

For every type of event there are Software interrupt number are defined.
for example using keyboard, sound, mouse.
Here for mouse interrupt number is 33h.
and for all types of operation like show mouse pointer, initialize mouse, restrict mouse pointer on screen etc.. we have different Service numbers.

Generally service number will be provided inax register,
so here we will write something like i.x.ax
now all the input information will be provided in variable of type REGS, and we will get out put in similar union varible

In our program we have declared
union i,o;
we will use i as input o as output,
so this are some of service numbers for mouse