Thread: help with ReadConsoleInput please

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    6

    help with ReadConsoleInput please

    Hi. Can someone see what is wrong with this section of code?

    Code:
    while(1)
    {
    ReadConsoleInput(hStdin,irInBuf,128, &cNumRead);
    
    if (irInBuf[cNumRead-1].Event.MouseEvent.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED || irInBuf[cNumRead-1].Event.MouseEvent.dwButtonState == RIGHTMOST_BUTTON_PRESSED)
    						
    break;
    	}
    It works fine on my computer, but when I compile the program on another computer, the program doesn't seem to respond to the mouseclick anymore. Is it a problem of operating systems? (I'm using WinXP, and the other computer is running Win 2000 professional)
    Thanks.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,971
    You're only checking the last input record and your using "==" to check a single bit within the dwButtonState bit-mask.

    Here's part 5 of a nice console programming tutorial - you may want to read all parts.
    http://www.adrianxw.dk/SoftwareSite/...Consoles5.html

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ReadConsoleInput behaves bad.
    By antex in forum Windows Programming
    Replies: 2
    Last Post: 10-25-2005, 12:02 PM
  2. help with ReadConsoleInput()
    By Verbenaca in forum Windows Programming
    Replies: 6
    Last Post: 06-09-2005, 04:24 PM
  3. ReadConsoleInput Reading Multiple Records
    By manofsteel972 in forum Windows Programming
    Replies: 1
    Last Post: 10-26-2004, 10:57 PM
  4. ReadConsole() / ReadConsoleInput()
    By LuckY in forum Windows Programming
    Replies: 2
    Last Post: 02-10-2003, 12:54 PM