Mouse pointer

Mouse pointer that click on a text and perform automatically.

Page 1 of 1

3 Replies - 3838 Views - Last Post: 13 June 2010 - 07:00 AM Rate Topic: -----

#1 AbdusSalam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 09-June 10

Mouse pointer

Posted 13 June 2010 - 06:26 AM

How can i create a c/c++ program in turbo c++ that i click on suppose "Exit" and it exit from my exe file?
Is This A Good Question/Topic? 0
  • +

Replies To: Mouse pointer

#2 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Mouse pointer

Posted 13 June 2010 - 06:40 AM

First of all, we will not be writing any code for you and there are Two reasons why:

#1: Turbo C++ is VERY VERY VERY VERY VERY OLD and no one but students that are being forced to waste their time learning 20 year old programming techniques care anymore. Plus, Turbo C++ does not even run on most modern computers so even if someone WANTED to write an example for you, they would have to jump though hoops just to build an environment to write the program in. -- Turbo C++ programming is VERY OLD and you are all but wasting your time with it. (There are actually some good points that I am ignoring here... because I belive the bad far out weigh the good).

#2 it is against site policy to provide code example before the original poster has made an honest effort to solve the problem on their own. You have not.
[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: Mouse pointer

Posted 13 June 2010 - 06:51 AM

however... what we can do is offer you some resources to look at:

How to exit a program: Programs generally exit when they reach "return" in main() -- generally in C/C++ you would like to ensure that objects are properly disposed of and resources properly closed out, and the computer state returned to normal (i.e. exit graphics mode or reset screen colors etc). -- So generally exiting a C++ program means working your way out of scope and ensuring proper cleanup.

If you wish to just exit without all of the above you can use the "exit(value)" command which will just exit the program and return the "value" as the ERRORLEVEL of the program.

To use the mouse you need to either use a mouse library (you can find lots of old Turbo C++/DOS type libraries on programmersheaven.com in the archives. see here, a library here and if you do a search (they used to have an archives section but I could not find it) you will find many other old libraries).
Was This Post Helpful? 0
  • +
  • -

#4 Munawwar  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 162
  • View blog
  • Posts: 457
  • Joined: 20-January 10

Re: Mouse pointer

Posted 13 June 2010 - 07:00 AM

Ah, why do you want to use turbo? The full screen mode doesn't even work on windows vista and above. (And I think it doesn't even run on 64-bit OS). Get a newer compiler.

But if you *really* want an answer:
You can get the mouse pointer in graphics mode or text mode, using either
(1) inline assembly, to use 8086 software interrupts (33h is mouse interrupt) like so:
asm {
mov ax,0x0001
int 0x33
}
I got this interrupt number from here

or
(2) Use int86 or int86x functions to call the same interrupts.

Here's Ralph brown's interrupt list which lists all the DOS interrupts you will ever need.
(Funny, I remember all these junk)

Anyway, take my advice, get a newer compiler and IDE.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1