Thread: Mouse support in console mode

  1. #1
    Code Warrior
    Join Date
    Nov 2001
    Posts
    669

    Question Mouse support in console mode

    I totally completed my menu code. My menu is now a complete emulation of a windows menu. But my menu only supports the keyboard input and now I want to write a code for the mouse support too, but I don't have a clue how to write it.

    For keyboard support I was writting in this style:
    Code:
    HANDLE hInput;
    INPUT_RECORD ir;
    DWORD dwRead;
    BOOL Loop;
    
    hInput  = GetStdHandle (STD_INPUT_HANDLE);
    
    while (Loop)
    {
      if ( ReadConsoleInput(hInput, &ir, 1, &dwRead) && (ir.EventType == KEY_EVENT) && (ir.Event.KeyEvent.bKeyDown) )
      {
        switch (ir.Event.KeyEvent.wVirtualKeyCode)
          {
            case VK_RETURN:
              Loop = FALSE;
          }
      }
    }
    I just want an example for the mouse. Thanks!

    BTW: I'm writting a win32 console application and I'm using VC++ 6.0 compiler on Win98.
    Current projects:
    1) User Interface Development Kit (C++)
    2) HTML SDK (C++)
    3) Classes (C++)
    4) INI Editor (Delphi)

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    247
    suggest you have search on google for winAPI functions or visit the microsoft site for same. May be better to post this on the windows board, but you may get the same answer.
    hoping to be certified (programming in c)
    here's the news - I'm officially certified.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to change background color in console mode
    By smore in forum C++ Programming
    Replies: 1
    Last Post: 12-02-2003, 01:44 PM
  2. Scroll in win32 console mode
    By GaPe in forum C Programming
    Replies: 3
    Last Post: 04-28-2002, 07:02 AM
  3. opening mp3s from console mode
    By Leeman_s in forum C++ Programming
    Replies: 1
    Last Post: 04-26-2002, 09:47 PM
  4. Just one Question?
    By Irish-Slasher in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2002, 10:19 AM