How Do You Allow The User To Move The Mouse In A Console Window, Like MS-DOS EDIT or other Mouse Supporting Programs?
Any Replies Would Be Appreciated
:confused: :confused: :confused: :confused: :confused:
Printable View
How Do You Allow The User To Move The Mouse In A Console Window, Like MS-DOS EDIT or other Mouse Supporting Programs?
Any Replies Would Be Appreciated
:confused: :confused: :confused: :confused: :confused:
If your program is a true-DOS application, then you have to use all kinds of creepy inline assembly. :eek:
If your program is a "fake-DOS" application ("Win32 Console Application", created with AllocConsole and stuff like that), then you can use the Console API functions to do this:
I recommend to not even write a console application unless absolutely necessary. :rolleyes:
- Call GetStdHandle(STD_INPUT_HANDLE) to get the input handle of your console.
- Call SetConsoleMode with the input handle and the ENABLE_MOUSE_INPUT flag to enable mouse events.
- Use ReadConsoleInput to be notified of console events.
- When the EventType member of the INPUT_RECORD structure is equal to MOUSE_EVENT, then the rest of the INPUT_RECORD structure is a MOUSE_EVENT_RECORD structure, which contains useful information about the mouse event.
Thanks, And Yes, Its A Console App ( Even That Code Sounds Creepy, i mean, Wouldnt That Code Sound Creepy to ANY 11 year old ;) :D ), But im Having Trouble Finding the PUT_RECORD structure in any of the VB api Viewers i've Tried...comments,structures,code,etc. welcome