How can I get and Display the consoles Mouse position

I've tried using the code from http://www.adrianxw.dk/SoftwareSite/Consoles/Consoles5.html But it all seems to just break - It sometimes gives me the position but even with changing his code I'm not getting the output I want.

So i was wondering if it's possible to show the mouse' cursor and make it display the position in the console.

Cheers,
Myth.
Not to sidetrack you, but why are you using the console if you want mouse input? Why not go with a widget-driven app (ie: WinAPI, or a crossplatform lib like wxWidgets).
No real reason to be honest - Just something I'm trying to figure out for self gain. I enjoy making some over the top console stuff for game demoing before I make it all with graphics. Just one of my ways of doing things I guess.
You have to play with SetConsoleMode()
http://www.google.com/search?btnI=1&q=msdn+setconsolemode

After that you'll want to use ReadConsoleInput() to implement your event loop (input from keyboard, mouse, etc).
http://www.google.com/search?btnI=1&q=msdn+readconsoleinput

Good luck and have fun!
mouse programming is possible with win32 only. console may not support it.
Did you bother to click on the links I just posted?
Sorry if that's aimed at me Duoas - I got it working but I had another topic trying to make it so the mouse cursor would work (which i got it working thanks to you) but make it so it's invisible. As i hate seeing the actual cursor.

So trying to still figure that out - was trying with the win32 functions but no luck.
No, I was responding to "mouse programming is possible with win32 only" -- which is not true:

first - mouse programming has been in use since before Win32 existed
second - the console application is Win32, so all the Win32 console input procedures work just fine for getting mouse input -- just like they were designed to do.
Thanks mate, damn your very knowledgeable about programming. Good to have someone like you around on these boards :)
it was a quick suggestion thats it.. because why one wants to set a mouse cursor in console..

and if you talk about console programming.. then i can create cursors, find the positions blah blah... in dos mode without even booting into windows. but thats a different topic.
I wasn't attacking you. Just be careful what truth there is to what you post. (I've been called on errors too...)

My post was both surprise and complaint to you that 21/2 hours after I posted links to exactly the API functions necessary to satisfy Mythios's request you posted an answer that very strongly suggests that it cannot be done outside a GUI application -- showing that you were simply being too lazy/tired/whatever to have actually read the thread.

I actually was surprised as you are typically exceedingly helpful. I have off days too.
hmmm...
you are right .. i started checking the forum between a very busy session just to relax myself.. not finding any good queries and in a hurry answered this.. actually the thing was generally people here dont do much advanced stuff so i though mythios wants to do some mouse programming and i wrote about win32.. not realizing that he may be interested in console only..

anyway.. my apologies if was a little rude to reply to u..
Topic archived. No new replies allowed.