DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   mouse functions for DOS (http://www.daniweb.com/forums/thread105662.html)

RossSCann Jan 21st, 2008 6:36 pm
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

Ancient Dragon Jan 21st, 2008 7:02 pm
Re: mouse functions for DOS
 
win32 api GetConsoleCursorInfo()

Duoas Jan 21st, 2008 7:05 pm
Re: mouse functions for DOS
 
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.

Ancient Dragon Jan 21st, 2008 7:41 pm
Re: mouse functions for DOS
 
Quote:

Originally Posted by Duoas (Post 515073)
[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 Jan 21st, 2008 8:01 pm
Re: mouse functions for DOS
 
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.

RossSCann Jan 22nd, 2008 3:30 pm
Re: mouse functions for DOS
 
Quote:

Originally Posted by Ancient Dragon (Post 515091)
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 Jan 22nd, 2008 3:50 pm
Re: mouse functions for DOS
 
The cost of MSDN is way more than a hobby programmer can justify

Duoas Jan 22nd, 2008 4:15 pm
Re: mouse functions for DOS
 
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.

Ancient Dragon Jan 22nd, 2008 4:20 pm
Re: mouse functions for DOS
 
Quote:

Originally Posted by Duoas (Post 515711)
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.

Duoas Jan 22nd, 2008 4:23 pm
Re: mouse functions for DOS
 
Ah, I understand what happened.

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


All times are GMT -4. The time now is 6:36 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC