Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Draw a cube Pin
Nelek13-Jun-07 8:03
protectorNelek13-Jun-07 8:03 
Questionsave file in database Pin
Y_Kaushik13-Jun-07 1:35
Y_Kaushik13-Jun-07 1:35 
AnswerRe: save file in database Pin
James R. Twine13-Jun-07 2:32
James R. Twine13-Jun-07 2:32 
GeneralRe: save file in database Pin
Y_Kaushik13-Jun-07 2:47
Y_Kaushik13-Jun-07 2:47 
GeneralRe: save file in database Pin
James R. Twine13-Jun-07 3:11
James R. Twine13-Jun-07 3:11 
GeneralRe: save file in database Pin
David Crow13-Jun-07 3:30
David Crow13-Jun-07 3:30 
Questionread keyboard keys Pin
deeps_cute13-Jun-07 1:15
deeps_cute13-Jun-07 1:15 
AnswerRe: read keyboard keys Pin
Programm3r13-Jun-07 1:46
Programm3r13-Jun-07 1:46 
Hi,

If I understand your question correctly, try using one of these

_getch, _getche
Get a character from the console without echo (_getch) or with echo (_getche).
<br />
int _getch( void );<br />
int _getche( void );<br />


Example
/* GETCH.C: This program reads characters from
 * the keyboard until it receives a 'Y' or 'y'.
 */

#include <conio.h>
#include <ctype.h>

void main( void )
{
   int ch;

   _cputs( "Type 'Y' when finished typing keys: " );
   do
   {
      ch = _getch();
      ch = toupper( ch );
   } while( ch != 'Y' );

   _putch( ch );
   _putch( '\r' );    /* Carriage return */
   _putch( '\n' );    /* Line feed       */
}


_kbhit
Checks the console for keyboard input.

int _kbhit( void );

Example
/* KBHIT.C: This program loops until the user
 * presses a key. If _kbhit returns nonzero, a
 * keystroke is waiting in the buffer. The program
 * can call _getch or _getche to get the keystroke.
 */

#include <conio.h>
#include <stdio.h>

void main( void )
{
   /* Display message until key is pressed. */
   while( !_kbhit() )
      _cputs( "Hit me!! " );

   /* Use _getch to throw key away. */
   printf( "\nKey struck was '%c'\n", _getch() );
   _getch();
}


Or have a look at SendKeys in C++[^]

Regards,


The only programmers that are better than C programmers are those who code in 1's and 0's..... Smile | :)

Smile | :) Programm3r

My Blog: ^_^

AnswerRe: read keyboard keys Pin
James R. Twine13-Jun-07 2:19
James R. Twine13-Jun-07 2:19 
AnswerRe: read keyboard keys Pin
Hamid_RT13-Jun-07 3:27
Hamid_RT13-Jun-07 3:27 
QuestionTo be modal or not to be modal Pin
Wim Engberts13-Jun-07 1:15
Wim Engberts13-Jun-07 1:15 
AnswerRe: To be modal or not to be modal Pin
James R. Twine13-Jun-07 2:29
James R. Twine13-Jun-07 2:29 
GeneralRe: To be modal or not to be modal Pin
Wim Engberts13-Jun-07 2:43
Wim Engberts13-Jun-07 2:43 
Questionxcx Pin
suchon_phuong13-Jun-07 1:04
suchon_phuong13-Jun-07 1:04 
QuestionPhysical disk information of a remote system Pin
kvrnkiran13-Jun-07 0:48
kvrnkiran13-Jun-07 0:48 
AnswerRe: Physical disk information of a remote system Pin
Matthew Faithfull13-Jun-07 2:08
Matthew Faithfull13-Jun-07 2:08 
QuestionCreating TimeStamp Pin
Programm3r13-Jun-07 0:33
Programm3r13-Jun-07 0:33 
AnswerRe: Creating TimeStamp Pin
kvrnkiran13-Jun-07 1:08
kvrnkiran13-Jun-07 1:08 
GeneralRe: Creating TimeStamp Pin
Programm3r13-Jun-07 1:32
Programm3r13-Jun-07 1:32 
AnswerRe: Creating TimeStamp Pin
Hans Ruck13-Jun-07 1:16
Hans Ruck13-Jun-07 1:16 
GeneralRe: Creating TimeStamp Pin
Programm3r13-Jun-07 1:31
Programm3r13-Jun-07 1:31 
AnswerRe: Creating TimeStamp Pin
David Crow13-Jun-07 2:56
David Crow13-Jun-07 2:56 
GeneralRe: Creating TimeStamp Pin
Programm3r13-Jun-07 4:12
Programm3r13-Jun-07 4:12 
QuestionAbout compilation in VS 2005 Pin
Nandu_77b13-Jun-07 0:30
Nandu_77b13-Jun-07 0:30 
AnswerRe: About compilation in VS 2005 Pin
Programm3r13-Jun-07 0:35
Programm3r13-Jun-07 0:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.