ReactOS
0.4.16-dev-1059-gb1cf981
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
main.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <tchar.h>
3
#include <windows.h>
4
5
int
main
()
6
{
7
TCHAR
Buffer
= 0;
8
DWORD
Count
= 0;
9
10
//
11
// We clear the mode, most importantly turn off ENABLE_ECHO_INPUT and ENABLE_LINE_INPUT
12
// This is the same mode as that is set up by getch() when trying to get a char
13
//
14
SetConsoleMode
(
GetStdHandle
(
STD_INPUT_HANDLE
),0);
15
16
//
17
// We read one char from the input and then return
18
//
19
ReadConsole
(
GetStdHandle
(
STD_INPUT_HANDLE
),&
Buffer
,1,&
Count
,
NULL
);
20
21
//
22
// We print out this char as an int to show that infact a backspace does count as input
23
//
24
_tprintf
(
TEXT
(
"You printed %c :: "
),
Buffer
);
25
_tprintf
(
TEXT
(
"With a value %d :: "
),
Buffer
);
26
_tprintf
(
TEXT
(
"Number of chars received %lu :: "
),
Count
);
27
_tprintf
(
TEXT
(
"Char equal to backspace %d \n"
), (
Buffer
==
TEXT
(
'\b'
)));
28
29
//
30
// :)
31
//
32
return
0;
33
}
GetStdHandle
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition:
console.c:203
Buffer
Definition:
bufpool.h:45
NULL
#define NULL
Definition:
types.h:112
SetConsoleMode
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
Definition:
console.c:1606
main
int main()
Definition:
test.c:6
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
_tprintf
#define _tprintf
Definition:
tchar.h:506
TEXT
#define TEXT(s)
Definition:
k32.h:26
Count
int Count
Definition:
noreturn.cpp:7
STD_INPUT_HANDLE
#define STD_INPUT_HANDLE
Definition:
winbase.h:293
ReadConsole
#define ReadConsole
Definition:
wincon.h:777
TCHAR
char TCHAR
Definition:
xmlstorage.h:189
modules
rostests
tests
readconsole
main.c
Generated on Wed Apr 30 2025 06:18:27 for ReactOS by
1.9.6