View Poll Results: Do You Write Console Applications?

Voters
4. You may not vote on this poll
  • Yes!

    2 50.00%
  • No!

    2 50.00%
  • What In The World Is That?

    0 0%
Results 1 to 3 of 3

Thread: Mouse In Console Applications

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    On The Internet
    Posts
    10

    Question Mouse In Console Applications

    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

    Last edited by Spaz; Jul 9th, 2001 at 12:42 PM.
    AvengerX
    AKA
    Spaz

    11 Years Old

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    If your program is a true-DOS application, then you have to use all kinds of creepy inline assembly.

    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:

    • 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.
    I recommend to not even write a console application unless absolutely necessary.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Location
    On The Internet
    Posts
    10
    Thanks, And Yes, Its A Console App ( Even That Code Sounds Creepy, i mean, Wouldnt That Code Sound Creepy to ANY 11 year old ), But im Having Trouble Finding the PUT_RECORD structure in any of the VB api Viewers i've Tried...comments,structures,code,etc. welcome
    Last edited by Spaz; Jul 8th, 2001 at 02:58 PM.
    AvengerX
    AKA
    Spaz

    11 Years Old

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width