943,865 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1938
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Jan 21st, 2008
0

mouse functions for DOS

Expand Post »
Does anyone know of a source of mouse functions for a console application in the visual C++.net developement environment package?
Thanks,
Ross
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
RossSCann is offline Offline
17 posts
since Jan 2007
Jan 21st, 2008
0

Re: mouse functions for DOS

Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Jan 21st, 2008
0

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.
Last edited by Duoas; Jan 21st, 2008 at 7:07 pm.
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007
Jan 21st, 2008
0

Re: mouse functions for DOS

Click to Expand / Collapse  Quote originally posted by Duoas ...
[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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Jan 21st, 2008
0

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.
Last edited by Ancient Dragon; Jan 21st, 2008 at 8:01 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Jan 22nd, 2008
0

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.
Unfortunately none of the samples have mouse functions.
Ross
Reputation Points: 10
Solved Threads: 0
Newbie Poster
RossSCann is offline Offline
17 posts
since Jan 2007
Jan 22nd, 2008
0

Re: mouse functions for DOS

The cost of MSDN is way more than a hobby programmer can justify
Last edited by Ancient Dragon; Jan 22nd, 2008 at 4:17 pm. Reason: unintentional error. Sorry.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
RossSCann is offline Offline
17 posts
since Jan 2007
Jan 22nd, 2008
0

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.
Last edited by Duoas; Jan 22nd, 2008 at 4:18 pm.
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007
Jan 22nd, 2008
0

Re: mouse functions for DOS

Click to Expand / Collapse  Quote originally posted by Duoas ...
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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Jan 22nd, 2008
0

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".)
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Class Movie...error undeclared identifier
Next Thread in C++ Forum Timeline: Help on function pointers





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC