How can I get the mouse click position in C++ in a Windows console program? (A variable that returns the position of the mouse when clicked)
I want to draw a menu wi
You'll need to use the *ConsoleInput family of methods (peek, read, etc). These operate on the console's input buffer, which includes keyboard and mouse events. The general strategy is:
lpNumberOfEventsRead
)MOUSE_EVENT
and MOUSE_EVENT_RECORD)You'll have to indicate that you want to retrieve mouse input using SetConsoleMode first though, as illustrated in this MSDN article.