Home

STARTFUSECOUNTCHARS

STARTF_USECOUNTCHARS is a flag used in the Windows API, specifically within the STARTUPINFO structure used by CreateProcess. It signals that the dwXCountChars and dwYCountChars members contain meaningful values for configuring a console for the new process.

When this flag is set in the STARTUPINFO.dwFlags field, the dwXCountChars and dwYCountChars members specify the

The canonical usage involves setting the flag, configuring dwXCountChars and dwYCountChars, and then calling CreateProcess. For

Value-wise, STARTF_USECOUNTCHARS corresponds to the bit 0x00000008 in STARTUPINFO.dwFlags, and it coexists with other flags such

size
of
the
console
screen
buffer,
in
character
cells,
for
the
child
process.
In
practice,
these
values
determine
the
initial
width
(dwXCountChars)
and
height
(dwYCountChars)
of
the
console
window’s
buffer.
The
flag
is
applicable
only
to
processes
that
use
a
console;
if
the
target
process
does
not
attach
to
a
console,
the
values
are
ignored.
example,
you
would
set
dwFlags
|=
STARTF_USECOUNTCHARS
and
set
dwXCountChars
and
dwYCountChars
to
the
desired
dimensions
before
launching
the
process.
The
constant
is
one
of
several
STARTF_*
flags
that
control
which
STARTUPINFO
fields
are
used
to
initialize
the
new
process.
as
STARTF_USESHOWWINDOW
and
STARTF_USESTDHANDLES.
See
also
STARTUPINFO,
CreateProcess,
and
related
STARTF
flags
for
broader
context.