954,148 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

mouse functions for DOS

Does anyone know of a source of mouse functions for a console application in the visual C++.net developement environment package?
Thanks,
Ross

RossSCann
Newbie Poster
18 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 
Ancient Dragon
Retired & Loving It
Team Colleague
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
 

I don't know about .NET, but the Win32 functions are all listed here: Console Functions (MSDN) .

You will need to enable mouse input with SetConsoleMode.
You can read it using ReadConsoleInput.

Use GetStdHandle to get a windows handle for the console input.
Use GetNumberOfConsoleInputEvents to poll for any console input, or use the console input handle with one of the wait functions .

Hope this helps.

[EDIT] Alas, AD, the cursor info is for the little blinking square or underline in the output console display.

Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
 
[EDIT] Alas, AD, the cursor info is for the little blinking square or underline in the output console display.


Ah yes -- that only sets the size of that blinking cursor. Need to call ReadConsoleInput() to retrieve the mouse events.

Ancient Dragon
Retired & Loving It
Team Colleague
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
 

Here are some example console programs . I have not used to code for a few years, but since its win32 api functions I suppose the programs will work with modern compilers.

Ancient Dragon
Retired & Loving It
Team Colleague
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
 
Here are some example console programs . I have not used to code for a few years, but since its win32 api functions I suppose the programs will work with modern compilers.


Unfortunately none of the samples have mouse functions.
Ross

RossSCann
Newbie Poster
18 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

The cost of MSDN is way more than a hobby programmer can justify

RossSCann
Newbie Poster
18 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

Those links don't work for you?

[EDIT]
Don't you dare put words in my mouth. If you want to edit your own posts again have fun.

Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
 

Those links don't work for you?

Don't you dare put words in my mouth. If you want to edit your own posts again have fun.

I agree completely and apologize for that error. I meant to quote your post, not edit it. I removed my post and put it below.

MSDN is FREE for god's sake. www.microsoft.com But I suspect you are talking about the subscriptions which have huge annual fees.

Ancient Dragon
Retired & Loving It
Team Colleague
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
 

Ah, I understand what happened.

Sorry RossSCann, I thought you had done the edit. (And I had flagged the post as "bad".)

Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
 

Ah, I understand what happened.

Sorry RossSCann, I thought you had done the edit. (And I had flagged the post as "bad".)

I took care of that too. :)

Ancient Dragon
Retired & Loving It
Team Colleague
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
 

You rock AD! :cool:

Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You