2000-02-17 20:38:33 +01:00
|
|
|
#ifndef _WINCON_H
|
|
|
|
#define _WINCON_H
|
2004-08-25 10:43:25 +02:00
|
|
|
#if __GNUC__ >= 3
|
* include/accctrl.h, aclapi.h, basetsd.h, basetyps.h, cderr.h,
cguid.h, commctrl.h, commdlg.h, cpl.h, cplext.h, custcntl.h,
dbt.h, dde.h, ddeml.h, dlgs.h, excpt.h, httpext.h, imagehlp.h,
imm.h, initguid.h, intshcut.h, ipexport.h, iphlpapi.h,
ipifcons.h, iprtrmib.h, iptypes.h, isguids.h, largeint.h, lm.h,
lmaccess.h, lmalert.h, lmapibuf.h, lmat.h, lmaudit.h,
lmbrowsr.h, lmchdev.h, lmconfig.h, lmcons.h, lmerr.h,
lmerrlog.h, lmmsg.h, lmremutl.h, lmrepl.h, lmserver.h,
lmshare.h, lmsname.h, lmstats.h, lmsvc.h, lmuse.h, lmuseflg.h,
lmwksta.h, lzexpand.h, mapi.h, mciavi.h, mcx.h, mmsystem.h,
mswsock.h, nb30.h, nddeapi.h, nspapi.h, ntdef.h, ntsecapi.h,
ntsecpkg.h, oaidl.h, objbase.h, objfwd.h, objidl.h, odbcinst.h,
ole.h, ole2.h, ole2ver.h, oleauto.h, olectl.h, olectlid.h,
oledlg.h, oleidl.h, pbt.h, prsht.h, psapi.h, rapi.h, ras.h,
raserror.h, rassapi.h, regstr.h, richedit.h, richole.h, rpc.h,
rpcdce.h, rpcdce2.h, rpcdcep.h, rpcndr.h, rpcnsi.h, rpcnsip.h,
rpcnterr.h, rpcproxy.h, schannel.h, schnlsp.h, scrnsave.h,
security.h, setupapi.h, shellapi.h, shlguid.h, shlobj.h, sql.h,
sqlext.h, sqltypes.h, sqlucode.h, sspi.h, subauth.h,
tlhelp32.h, unknwn.h, userenv.h, w32api.h, winbase.h, wincon.h,
wincrypt.h, windef.h, windows.h, windowsx.h, winerror.h,
wingdi.h, wininet.h, winioctl.h, winnetwk.h, winnls.h, winnt.h,
winperf.h, winreg.h, winresrc.h, winsock.h, winsock2.h,
winspool.h, winsvc.h, winuser.h, winver.h, ws2tcpip.h,
wsnetbs.h, wtypes.h, zmouse.h: Add #pragma GCC system_header
if __GNUC__ >= 3.
* include/mapi.h: Change header guard name to _MAPI_H for
consistency.
2002-03-09 10:04:10 +01:00
|
|
|
#pragma GCC system_header
|
|
|
|
#endif
|
|
|
|
|
2000-02-17 20:38:33 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define FOREGROUND_BLUE 1
|
|
|
|
#define FOREGROUND_GREEN 2
|
|
|
|
#define FOREGROUND_RED 4
|
|
|
|
#define FOREGROUND_INTENSITY 8
|
|
|
|
#define BACKGROUND_BLUE 16
|
|
|
|
#define BACKGROUND_GREEN 32
|
|
|
|
#define BACKGROUND_RED 64
|
|
|
|
#define BACKGROUND_INTENSITY 128
|
2004-08-25 10:43:25 +02:00
|
|
|
#if (_WIN32_WINNT >= 0x0501)
|
|
|
|
#define CONSOLE_FULLSCREEN_MODE 1
|
2005-07-18 07:43:22 +02:00
|
|
|
#define CONSOLE_WINDOWED_MODE 2
|
2004-08-25 10:43:25 +02:00
|
|
|
#endif
|
2000-02-17 20:38:33 +01:00
|
|
|
#define CTRL_C_EVENT 0
|
|
|
|
#define CTRL_BREAK_EVENT 1
|
|
|
|
#define CTRL_CLOSE_EVENT 2
|
|
|
|
#define CTRL_LOGOFF_EVENT 5
|
|
|
|
#define CTRL_SHUTDOWN_EVENT 6
|
|
|
|
#define ENABLE_LINE_INPUT 2
|
|
|
|
#define ENABLE_ECHO_INPUT 4
|
|
|
|
#define ENABLE_PROCESSED_INPUT 1
|
|
|
|
#define ENABLE_WINDOW_INPUT 8
|
|
|
|
#define ENABLE_MOUSE_INPUT 16
|
|
|
|
#define ENABLE_PROCESSED_OUTPUT 1
|
|
|
|
#define ENABLE_WRAP_AT_EOL_OUTPUT 2
|
|
|
|
#define KEY_EVENT 1
|
|
|
|
#define MOUSE_EVENT 2
|
|
|
|
#define WINDOW_BUFFER_SIZE_EVENT 4
|
|
|
|
#define MENU_EVENT 8
|
|
|
|
#define FOCUS_EVENT 16
|
|
|
|
#define CAPSLOCK_ON 128
|
|
|
|
#define ENHANCED_KEY 256
|
|
|
|
#define RIGHT_ALT_PRESSED 1
|
|
|
|
#define LEFT_ALT_PRESSED 2
|
|
|
|
#define RIGHT_CTRL_PRESSED 4
|
|
|
|
#define LEFT_CTRL_PRESSED 8
|
|
|
|
#define SHIFT_PRESSED 16
|
|
|
|
#define NUMLOCK_ON 32
|
|
|
|
#define SCROLLLOCK_ON 64
|
|
|
|
#define FROM_LEFT_1ST_BUTTON_PRESSED 1
|
|
|
|
#define RIGHTMOST_BUTTON_PRESSED 2
|
|
|
|
#define FROM_LEFT_2ND_BUTTON_PRESSED 4
|
|
|
|
#define FROM_LEFT_3RD_BUTTON_PRESSED 8
|
|
|
|
#define FROM_LEFT_4TH_BUTTON_PRESSED 16
|
|
|
|
#define MOUSE_MOVED 1
|
|
|
|
#define DOUBLE_CLICK 2
|
|
|
|
#define MOUSE_WHEELED 4
|
|
|
|
|
|
|
|
typedef struct _CHAR_INFO {
|
|
|
|
union {
|
|
|
|
WCHAR UnicodeChar;
|
|
|
|
CHAR AsciiChar;
|
|
|
|
} Char;
|
|
|
|
WORD Attributes;
|
2004-08-25 10:43:25 +02:00
|
|
|
} CHAR_INFO, *PCHAR_INFO;
|
2000-02-17 20:38:33 +01:00
|
|
|
typedef struct _SMALL_RECT {
|
|
|
|
SHORT Left;
|
|
|
|
SHORT Top;
|
|
|
|
SHORT Right;
|
|
|
|
SHORT Bottom;
|
2004-08-25 10:43:25 +02:00
|
|
|
} SMALL_RECT, *PSMALL_RECT;
|
2000-02-17 20:38:33 +01:00
|
|
|
typedef struct _CONSOLE_CURSOR_INFO {
|
|
|
|
DWORD dwSize;
|
|
|
|
BOOL bVisible;
|
|
|
|
} CONSOLE_CURSOR_INFO,*PCONSOLE_CURSOR_INFO;
|
|
|
|
typedef struct _COORD {
|
|
|
|
SHORT X;
|
|
|
|
SHORT Y;
|
2004-08-25 10:43:25 +02:00
|
|
|
} COORD, *PCOORD;
|
2003-03-17 11:01:07 +01:00
|
|
|
typedef struct _CONSOLE_FONT_INFO {
|
|
|
|
DWORD nFont;
|
|
|
|
COORD dwFontSize;
|
|
|
|
} CONSOLE_FONT_INFO, *PCONSOLE_FONT_INFO;
|
2000-02-17 20:38:33 +01:00
|
|
|
typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
|
|
|
|
COORD dwSize;
|
|
|
|
COORD dwCursorPosition;
|
|
|
|
WORD wAttributes;
|
|
|
|
SMALL_RECT srWindow;
|
|
|
|
COORD dwMaximumWindowSize;
|
|
|
|
} CONSOLE_SCREEN_BUFFER_INFO,*PCONSOLE_SCREEN_BUFFER_INFO;
|
|
|
|
typedef BOOL(CALLBACK *PHANDLER_ROUTINE)(DWORD);
|
|
|
|
typedef struct _KEY_EVENT_RECORD {
|
|
|
|
BOOL bKeyDown;
|
|
|
|
WORD wRepeatCount;
|
|
|
|
WORD wVirtualKeyCode;
|
|
|
|
WORD wVirtualScanCode;
|
|
|
|
union {
|
|
|
|
WCHAR UnicodeChar;
|
|
|
|
CHAR AsciiChar;
|
|
|
|
} uChar;
|
|
|
|
DWORD dwControlKeyState;
|
|
|
|
}
|
|
|
|
#ifdef __GNUC__
|
|
|
|
/* gcc's alignment is not what win32 expects */
|
|
|
|
PACKED
|
|
|
|
#endif
|
|
|
|
KEY_EVENT_RECORD;
|
|
|
|
|
|
|
|
typedef struct _MOUSE_EVENT_RECORD {
|
|
|
|
COORD dwMousePosition;
|
|
|
|
DWORD dwButtonState;
|
|
|
|
DWORD dwControlKeyState;
|
|
|
|
DWORD dwEventFlags;
|
|
|
|
} MOUSE_EVENT_RECORD;
|
|
|
|
typedef struct _WINDOW_BUFFER_SIZE_RECORD { COORD dwSize; } WINDOW_BUFFER_SIZE_RECORD;
|
|
|
|
typedef struct _MENU_EVENT_RECORD { UINT dwCommandId; } MENU_EVENT_RECORD,*PMENU_EVENT_RECORD;
|
|
|
|
typedef struct _FOCUS_EVENT_RECORD { BOOL bSetFocus; } FOCUS_EVENT_RECORD;
|
|
|
|
typedef struct _INPUT_RECORD {
|
|
|
|
WORD EventType;
|
|
|
|
union {
|
|
|
|
KEY_EVENT_RECORD KeyEvent;
|
|
|
|
MOUSE_EVENT_RECORD MouseEvent;
|
|
|
|
WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
|
|
|
|
MENU_EVENT_RECORD MenuEvent;
|
|
|
|
FOCUS_EVENT_RECORD FocusEvent;
|
|
|
|
} Event;
|
|
|
|
} INPUT_RECORD,*PINPUT_RECORD;
|
|
|
|
|
|
|
|
BOOL WINAPI AllocConsole(void);
|
2005-07-18 07:43:22 +02:00
|
|
|
#if (_WIN32_WINNT >= 0x0500)
|
|
|
|
#define ATTACH_PARENT_PROCESS ((DWORD)-1)
|
2003-10-06 11:45:59 +02:00
|
|
|
BOOL WINAPI AttachConsole(DWORD);
|
|
|
|
#endif
|
2002-06-19 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/ddeml.h (DdeCreateStringHandle{AW]:Correct
prototypes.
* include/winsvc.h (StartServiceW): Correct prototype.
* include/winbase.h (BackupRead,BackupSeek,BackupWrite,
FileTimeToLocalFileTime, GetAce,GetPrivateProfileStruct[AW],
GetTickCount,InterlockedExchangeAdd,
WritePrivateProfileStruct[AW]: Correct prototypes.
(GetEnvironmentStrings): Correct mapping to
GetEnvironmentStringsA.
* include/winver.h (VerQueryValueA,VerQueryValueW):
Correct prototypes.
* include/wincon.h (CreateConsoleScreenBuffer): Correct
prototype.
* include/winreg.h (RegQueryMultipleValues[AW],
RegQueryValueEx[AW]):Correct prototypes.
* include/wingdi.h (PXFORM, PLOGBRUSH, PLOGPEN, PPOLYTEXTA,
PPOLYTEXTW): Add typedefs.
(_DESIGNVECTOR,COLOR16, _TRIVERTEX, _DISPLAY_DEVICE): Add
structures and typedefs.
(MM_MAX_NUMAXES): Add define.
(EnumFontsW,GetEnhMetaFilePixelFormat,wglGetLayerPaletteEntries):
Correct prototypes.
* include/winerror.h (RPC_X_INVALID_PIPE_OBJECT,
RPC_X_WRONG_PIPE_ORDER,RPC_X_WRONG_PIPE_VERSION,
RPC_S_SEND_INCOMPLETE): Add defines.
2002-06-19 03:15:45 +02:00
|
|
|
HANDLE WINAPI CreateConsoleScreenBuffer(DWORD,DWORD,CONST SECURITY_ATTRIBUTES*,DWORD,LPVOID);
|
2000-02-17 20:38:33 +01:00
|
|
|
BOOL WINAPI FillConsoleOutputAttribute(HANDLE,WORD,DWORD,COORD,PDWORD);
|
|
|
|
BOOL WINAPI FillConsoleOutputCharacterA(HANDLE,CHAR,DWORD,COORD,PDWORD);
|
|
|
|
BOOL WINAPI FillConsoleOutputCharacterW(HANDLE,WCHAR,DWORD,COORD,PDWORD);
|
|
|
|
BOOL WINAPI FlushConsoleInputBuffer(HANDLE);
|
|
|
|
BOOL WINAPI FreeConsole(void);
|
|
|
|
BOOL WINAPI GenerateConsoleCtrlEvent(DWORD,DWORD);
|
|
|
|
UINT WINAPI GetConsoleCP(void);
|
|
|
|
BOOL WINAPI GetConsoleCursorInfo(HANDLE,PCONSOLE_CURSOR_INFO);
|
|
|
|
BOOL WINAPI GetConsoleMode(HANDLE,PDWORD);
|
|
|
|
UINT WINAPI GetConsoleOutputCP(void);
|
|
|
|
BOOL WINAPI GetConsoleScreenBufferInfo(HANDLE,PCONSOLE_SCREEN_BUFFER_INFO);
|
|
|
|
DWORD WINAPI GetConsoleTitleA(LPSTR,DWORD);
|
|
|
|
DWORD WINAPI GetConsoleTitleW(LPWSTR,DWORD);
|
2002-09-03 18:25:54 +02:00
|
|
|
#if (_WIN32_WINNT >= 0x0500)
|
2004-08-25 10:43:25 +02:00
|
|
|
BOOL WINAPI GetConsoleDisplayMode(LPDWORD);
|
2002-08-30 17:58:06 +02:00
|
|
|
HWND WINAPI GetConsoleWindow(void);
|
2002-09-03 18:25:54 +02:00
|
|
|
#endif
|
2000-02-17 20:38:33 +01:00
|
|
|
COORD WINAPI GetLargestConsoleWindowSize(HANDLE);
|
|
|
|
BOOL WINAPI GetNumberOfConsoleInputEvents(HANDLE,PDWORD);
|
|
|
|
BOOL WINAPI GetNumberOfConsoleMouseButtons(PDWORD);
|
|
|
|
BOOL WINAPI PeekConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
|
|
|
|
BOOL WINAPI PeekConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
|
|
|
|
BOOL WINAPI ReadConsoleA(HANDLE,PVOID,DWORD,PDWORD,PVOID);
|
|
|
|
BOOL WINAPI ReadConsoleW(HANDLE,PVOID,DWORD,PDWORD,PVOID);
|
|
|
|
BOOL WINAPI ReadConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
|
|
|
|
BOOL WINAPI ReadConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
|
|
|
|
BOOL WINAPI ReadConsoleOutputAttribute(HANDLE,LPWORD,DWORD,COORD,LPDWORD);
|
|
|
|
BOOL WINAPI ReadConsoleOutputCharacterA(HANDLE,LPSTR,DWORD,COORD,PDWORD);
|
|
|
|
BOOL WINAPI ReadConsoleOutputCharacterW(HANDLE,LPWSTR,DWORD,COORD,PDWORD);
|
|
|
|
BOOL WINAPI ReadConsoleOutputA(HANDLE,PCHAR_INFO,COORD,COORD,PSMALL_RECT);
|
|
|
|
BOOL WINAPI ReadConsoleOutputW(HANDLE,PCHAR_INFO,COORD,COORD,PSMALL_RECT);
|
|
|
|
BOOL WINAPI ScrollConsoleScreenBufferA(HANDLE,const SMALL_RECT*,const SMALL_RECT*,COORD,const CHAR_INFO*);
|
|
|
|
BOOL WINAPI ScrollConsoleScreenBufferW(HANDLE,const SMALL_RECT*,const SMALL_RECT*,COORD,const CHAR_INFO*);
|
|
|
|
BOOL WINAPI SetConsoleActiveScreenBuffer(HANDLE);
|
|
|
|
BOOL WINAPI SetConsoleCP(UINT);
|
|
|
|
BOOL WINAPI SetConsoleCtrlHandler(PHANDLER_ROUTINE,BOOL);
|
|
|
|
BOOL WINAPI SetConsoleCursorInfo(HANDLE,const CONSOLE_CURSOR_INFO*);
|
|
|
|
BOOL WINAPI SetConsoleCursorPosition(HANDLE,COORD);
|
2004-08-25 10:43:25 +02:00
|
|
|
#if (_WIN32_WINNT >= 0x0501)
|
|
|
|
BOOL WINAPI SetConsoleDisplayMode(HANDLE,DWORD,PCOORD);
|
|
|
|
#endif
|
2000-02-17 20:38:33 +01:00
|
|
|
BOOL WINAPI SetConsoleMode(HANDLE,DWORD);
|
|
|
|
BOOL WINAPI SetConsoleOutputCP(UINT);
|
|
|
|
BOOL WINAPI SetConsoleScreenBufferSize(HANDLE,COORD);
|
|
|
|
BOOL WINAPI SetConsoleTextAttribute(HANDLE,WORD);
|
|
|
|
BOOL WINAPI SetConsoleTitleA(LPCSTR);
|
|
|
|
BOOL WINAPI SetConsoleTitleW(LPCWSTR);
|
|
|
|
BOOL WINAPI SetConsoleWindowInfo(HANDLE,BOOL,const SMALL_RECT*);
|
|
|
|
BOOL WINAPI WriteConsoleA(HANDLE,PCVOID,DWORD,PDWORD,PVOID);
|
|
|
|
BOOL WINAPI WriteConsoleW(HANDLE,PCVOID,DWORD,PDWORD,PVOID);
|
|
|
|
BOOL WINAPI WriteConsoleInputA(HANDLE,const INPUT_RECORD*,DWORD,PDWORD);
|
|
|
|
BOOL WINAPI WriteConsoleInputW(HANDLE,const INPUT_RECORD*,DWORD,PDWORD);
|
|
|
|
BOOL WINAPI WriteConsoleOutputA(HANDLE,const CHAR_INFO*,COORD,COORD,PSMALL_RECT);
|
|
|
|
BOOL WINAPI WriteConsoleOutputW(HANDLE,const CHAR_INFO*,COORD,COORD,PSMALL_RECT);
|
|
|
|
BOOL WINAPI WriteConsoleOutputAttribute(HANDLE,const WORD*,DWORD,COORD,PDWORD);
|
|
|
|
BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE,LPCSTR,DWORD,COORD,PDWORD);
|
|
|
|
BOOL WINAPI WriteConsoleOutputCharacterW(HANDLE,LPCWSTR,DWORD,COORD,PDWORD);
|
|
|
|
|
|
|
|
#ifdef UNICODE
|
|
|
|
#define FillConsoleOutputCharacter FillConsoleOutputCharacterW
|
|
|
|
#define GetConsoleTitle GetConsoleTitleW
|
|
|
|
#define PeekConsoleInput PeekConsoleInputW
|
|
|
|
#define ReadConsole ReadConsoleW
|
|
|
|
#define ReadConsoleInput ReadConsoleInputW
|
|
|
|
#define ReadConsoleOutput ReadConsoleOutputW
|
|
|
|
#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW
|
|
|
|
#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW
|
|
|
|
#define SetConsoleTitle SetConsoleTitleW
|
|
|
|
#define WriteConsole WriteConsoleW
|
|
|
|
#define WriteConsoleInput WriteConsoleInputW
|
|
|
|
#define WriteConsoleOutput WriteConsoleOutputW
|
|
|
|
#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterW
|
|
|
|
#else
|
|
|
|
#define FillConsoleOutputCharacter FillConsoleOutputCharacterA
|
|
|
|
#define GetConsoleTitle GetConsoleTitleA
|
|
|
|
#define PeekConsoleInput PeekConsoleInputA
|
|
|
|
#define ReadConsole ReadConsoleA
|
|
|
|
#define ReadConsoleInput ReadConsoleInputA
|
|
|
|
#define ReadConsoleOutput ReadConsoleOutputA
|
|
|
|
#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA
|
|
|
|
#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA
|
|
|
|
#define SetConsoleTitle SetConsoleTitleA
|
|
|
|
#define WriteConsole WriteConsoleA
|
|
|
|
#define WriteConsoleInput WriteConsoleInputA
|
|
|
|
#define WriteConsoleOutput WriteConsoleOutputA
|
|
|
|
#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|