public interface Wincon
Modifier and Type | Field and Description |
---|---|
static int |
ATTACH_PARENT_PROCESS |
static int |
CONSOLE_FULLSCREEN |
static int |
CONSOLE_FULLSCREEN_HARDWARE |
static int |
CTRL_BREAK_EVENT |
static int |
CTRL_C_EVENT |
static int |
ENABLE_ECHO_INPUT |
static int |
ENABLE_EXTENDED_FLAGS |
static int |
ENABLE_INSERT_MODE |
static int |
ENABLE_LINE_INPUT |
static int |
ENABLE_MOUSE_INPUT |
static int |
ENABLE_PROCESSED_INPUT |
static int |
ENABLE_PROCESSED_OUTPUT |
static int |
ENABLE_QUICK_EDIT_MODE |
static int |
ENABLE_WINDOW_INPUT |
static int |
ENABLE_WRAP_AT_EOL_OUTPUT |
static int |
MAX_CONSOLE_TITLE_LENGTH |
static int |
STD_ERROR_HANDLE |
static int |
STD_INPUT_HANDLE |
static int |
STD_OUTPUT_HANDLE |
Modifier and Type | Method and Description |
---|---|
boolean |
AllocConsole()
Allocates a new console for the calling process.
|
boolean |
AttachConsole(int dwProcessId)
Attaches the calling process to the console of the specified process
|
boolean |
FlushConsoleInputBuffer(WinNT.HANDLE hConsoleInput)
Flushes the console input buffer.
|
boolean |
FreeConsole()
Detaches the calling process from its console
|
boolean |
GenerateConsoleCtrlEvent(int dwCtrlEvent,
int dwProcessGroupId)
Sends a specified signal to a console process group that shares the console
associated with the calling process.
|
int |
GetConsoleCP() |
boolean |
GetConsoleDisplayMode(IntByReference lpModeFlags)
Retrieves the display mode of the current console
|
boolean |
GetConsoleMode(WinNT.HANDLE hConsoleHandle,
IntByReference lpMode) |
int |
GetConsoleOriginalTitle(char[] lpConsoleTitle,
int nSize) |
int |
GetConsoleOutputCP() |
int |
GetConsoleTitle(char[] lpConsoleTitle,
int nSize) |
WinDef.HWND |
GetConsoleWindow() |
boolean |
GetNumberOfConsoleInputEvents(WinNT.HANDLE hConsoleInput,
IntByReference lpcNumberOfEvents) |
boolean |
GetNumberOfConsoleMouseButtons(IntByReference lpNumberOfMouseButtons) |
WinNT.HANDLE |
GetStdHandle(int nStdHandle) |
boolean |
SetConsoleCP(int wCodePageID) |
boolean |
SetConsoleMode(WinNT.HANDLE hConsoleHandle,
int dwMode) |
boolean |
SetConsoleOutputCP(int wCodePageID) |
boolean |
SetConsoleTitle(String lpConsoleTitle) |
boolean |
SetStdHandle(int nStdHandle,
WinNT.HANDLE hHandle) |
static final int ATTACH_PARENT_PROCESS
static final int CTRL_C_EVENT
static final int CTRL_BREAK_EVENT
static final int STD_INPUT_HANDLE
static final int STD_OUTPUT_HANDLE
static final int STD_ERROR_HANDLE
static final int CONSOLE_FULLSCREEN
static final int CONSOLE_FULLSCREEN_HARDWARE
static final int ENABLE_PROCESSED_INPUT
static final int ENABLE_LINE_INPUT
static final int ENABLE_ECHO_INPUT
static final int ENABLE_WINDOW_INPUT
static final int ENABLE_MOUSE_INPUT
static final int ENABLE_INSERT_MODE
static final int ENABLE_QUICK_EDIT_MODE
static final int ENABLE_EXTENDED_FLAGS
static final int ENABLE_PROCESSED_OUTPUT
static final int ENABLE_WRAP_AT_EOL_OUTPUT
static final int MAX_CONSOLE_TITLE_LENGTH
boolean AllocConsole()
true
if successful - if false
then use
GetLastError()
to get extended error informationboolean FreeConsole()
true
if successful - if false
then use
GetLastError()
to get extended error informationboolean AttachConsole(int dwProcessId)
dwProcessId
- The identifier of the process whose console is to
be used. Can be either the process ID or the special ATTACH_PARENT_PROCESS
value to indicate the console of the parent of the current process.true
if successful - if false
then use
GetLastError()
to get extended error informationboolean FlushConsoleInputBuffer(WinNT.HANDLE hConsoleInput)
hConsoleInput
- A handle to the console input buffer. The handle must
have the GENERIC_WRITE access right.true
if successful - if false
then use
GetLastError()
to get extended error informationboolean GenerateConsoleCtrlEvent(int dwCtrlEvent, int dwProcessGroupId)
dwCtrlEvent
- The type of signal to be generated.dwProcessGroupId
- The identifier of the process group to receive the signaltrue
if successful - if false
then use
GetLastError()
to get extended error informationint GetConsoleCP()
boolean SetConsoleCP(int wCodePageID)
wCodePageID
- The identifier of the code page to be settrue
if successful - if false
then use
GetLastError()
to get extended error informationint GetConsoleOutputCP()
boolean SetConsoleOutputCP(int wCodePageID)
wCodePageID
- The output code page used by the console associated with the calling process.true
if successful - if false
then use
GetLastError()
to get extended error informationWinDef.HWND GetConsoleWindow()
boolean GetNumberOfConsoleInputEvents(WinNT.HANDLE hConsoleInput, IntByReference lpcNumberOfEvents)
hConsoleInput
- A handle to the console input buffer. The handle must
have the GENERIC_READ access rightlpcNumberOfEvents
- A pointer to a variable that receives the number
of unread input records in the console's input buffertrue
if successful - if false
then use
GetLastError()
to get extended error informationboolean GetNumberOfConsoleMouseButtons(IntByReference lpNumberOfMouseButtons)
lpNumberOfMouseButtons
- A pointer to a variable that receives the number
of mouse buttonstrue
if successful - if false
then use
GetLastError()
to get extended error informationWinNT.HANDLE GetStdHandle(int nStdHandle)
nStdHandle
- The standard device identifierboolean SetStdHandle(int nStdHandle, WinNT.HANDLE hHandle)
nStdHandle
- The standard device identifierhHandle
- The handle for the standard devicetrue
if successful - if false
then use
GetLastError()
to get extended error informationboolean GetConsoleDisplayMode(IntByReference lpModeFlags)
lpModeFlags
- The display mode of the consoletrue
if successful - if false
then use
GetLastError()
to get extended error informationboolean GetConsoleMode(WinNT.HANDLE hConsoleHandle, IntByReference lpMode)
hConsoleHandle
- A handle to the console input buffer or the console
screen buffer. The handle must have the GENERIC_READ access rightlpMode
- A pointer to a variable that receives the current mode of
the specified buffertrue
if successful - if false
then use
GetLastError()
to get extended error informationboolean SetConsoleMode(WinNT.HANDLE hConsoleHandle, int dwMode)
hConsoleHandle
- A handle to the console input buffer or a
console screen buffer. The handle must have the GENERIC_READ access rightdwMode
- The input or output mode mask to be settrue
if successful - if false
then use
GetLastError()
to get extended error informationint GetConsoleTitle(char[] lpConsoleTitle, int nSize)
lpConsoleTitle
- A pointer to a buffer that receives a null-terminated
string containing the title. If the buffer is too small to store the title,
the function stores as many characters of the title as will fit in the buffer,
ending with a null terminator. Note: use Native.toString(char[])
to convert it to a String
valuenSize
- The size of the buffer pointed to by the lpConsoleTitle parameter,
in characters.GetLastError
returns the error code.int GetConsoleOriginalTitle(char[] lpConsoleTitle, int nSize)
lpConsoleTitle
- A pointer to a buffer that receives a null-terminated
string containing the original title. Note: use Native.toString(char[])
to convert it to a String
valuenSize
- The size of the lpConsoleTitle buffer, in charactersGetLastError
returns
ERROR_SUCCESS
. If the function fails, the return value is zero
and GetLastError
returns the error code.boolean SetConsoleTitle(String lpConsoleTitle)
lpConsoleTitle
- The string to be displayed in the title bar of the console window.
The total size must be less than MAX_CONSOLE_TITLE_LENGTH
.true
if successful - if false
then use
GetLastError()
to get extended error information