0% found this document useful (0 votes)
102 views5 pages

Write A Program in VC++ To Read Keystrokes From The Keyboard

The document provides steps to write a program in VC++ to read keystrokes from the keyboard. It instructs the user to set up storage for keyboard data by initializing an empty string in the constructor of the document class. It then explains how to add a WM_CHAR message to read keystrokes, record characters in the on_char method of the view class, and display the recorded characters in the on_draw method.

Uploaded by

ahmadfiroz
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views5 pages

Write A Program in VC++ To Read Keystrokes From The Keyboard

The document provides steps to write a program in VC++ to read keystrokes from the keyboard. It instructs the user to set up storage for keyboard data by initializing an empty string in the constructor of the document class. It then explains how to add a WM_CHAR message to read keystrokes, record characters in the on_char method of the view class, and display the recorded characters in the on_draw method.

Uploaded by

ahmadfiroz
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

WRITE A PROGRAM IN VC++ TO READ KEYSTROKES FROM THE

KEYBOARD

HOW TO

1. SETTING UP STORAGE FOR OUR KEYBOARD DATA

OPEN DOCUMENT CLASS


INTIALIZE THE STRING
WRITE CODE SHOWN IN THE SNAPSHOT

2. INITIALIZE EMPTY STRING IN CONSTRUCTOR OF DOCUMENT CLASS


WRITE CODE SHOWN IN SNAPSHOT

3. READING KEYSTROKE
ADD WM_CHAR MESSAGE
HOW::--- VIEW->CLASS WIZARD->SET CLASS NAME TO VIEW->FIND OBJECT
ID AS WM_CHARDOUBLE CLICK ON THAT (U WILL SEE IT WILL APPEAR
IN FRONT OF ON_CHAR CLICK OK

4. RECORDING CHAR IN OUR DOCUMENT


FIND ON_CHAR( ) METHOD IN VIEW CLASS(LEFT SIDE OF YOUR CODE
WINDOW)
WRITE THE CODE SHOWN IN SHAPSHOT IN ON_CHAR METHOD BY DOUBLE
CLICKING IT

5.OPEN ON_DRAW() METHOD OF VIEW CLASS AND WRITE THE CODE


SHOWN IN SNAPSHOT
PROGRAM NO
WRITE A PROGRAM IN VC++ TO READ KEYSTROKES FROM THE
KEYBOARD

STEP 1

SETTING UP STORAGE FOR OUR KEYBOARD DATA

2.INITIALIZING EMPTY STRING IN CONSTRUCTOR OF DOC CLASS


3. READING KEYSTROKE
ADD WM_CHAR MESSAGE FROM CLASS WIZARD

4. RECORDING CHAR IN OUR DOCUMENT


CODING IN ON_CHAR OF VIEW CLASS
5. IN ON_DRAW( ) METHOD OF VIEW CLASS AND WRITE THE CODE
OUTPUT

You might also like