// Copyright distributed.net 1997-1999 - All Rights Reserved
// For use in distributed.net projects only.
// Any other distribution or use of this source violates copyright.
//
// $Log: w32cons.h,v $
// Revision 1.13  1999/01/01 02:45:20  cramer
// Part 1 of 1999 Copyright updates...
//
// Revision 1.12  1998/12/25 09:17:36  cyp
// Right-click benchmark now supports both long and short versions.
//
// Revision 1.11  1998/12/05 22:28:46  cyp
// Added -kill/-hup support.
//
// Revision 1.10  1998/12/01 00:16:54  cyp
// win16 endsession is now handled 'correctly'. Version check for win32
// service start fixed.
//
// Revision 1.9  1998/11/11 05:38:59  cyp
// Added w32ConGetPos(), w32ConSetPos(), w32GetWinVersion() [returns x+20 for NT]
//
// Revision 1.8  1998/11/08 20:11:10  cyp
// Added w32ConGetSize()
//
// Revision 1.7  1998/10/26 04:28:16  cyp
// Something changed, but I don't remember what...
//
// Revision 1.5  1998/10/11 05:50:43  cyp
// Lots of fixes.
//
// Revision 1.4  1998/10/11 00:34:17  cyp
// Added cowie's console emu functions.
//
// Revision 1.3  1998/10/07 18:19:29  silby
// Finished AutoClose support.  Seems to work well.
//
// Revision 1.2  1998/10/05 05:11:34  cyp
// Implemented: (a) conditional destruction, ala Press any key..., of the
// client's window on deinit (b) to activate the client's window from WinMain.
//
// Revision 1.1  1998/10/03 12:24:43  cyp
// Created.
//

#ifndef __W32CONS_H__
#define __W32CONS_H__

#define IDM_SHUTDOWN        1
#define IDM_RESTART         2
#define IDM_PAUSE           3
#define IDM_CONFIG          4
#define IDM_FETCH           5
#define IDM_FLUSH           6
#define IDM_UPDATE          7
#define IDM_BENCHRC5_SHORT  8
#define IDM_BENCHDES_SHORT  9
#define IDM_BENCHRC5_LONG  10
#define IDM_BENCHDES_LONG  11

int w32InitializeConsole(int runhidden, int runmodes);

int w32DeinitializeConsole(void);

/* clear window - returns !0 if error */
int w32ConClear(void);

/* activate client window if not -hidden */
int w32ConShowWindow(void); 

/* getch() */
int w32ConGetch(void);

/* kbhit() */
int w32ConKbhit(void);

/* print a string to the console */
int w32ConOut(const char *text);

/* pump waiting messages */
void w32Yield(void);

/* pump waiting messages for x millsecs */
void w32Sleep(unsigned int millisecs);

/* does console refer to the screen */
int w32ConIsScreen(void);

/* get size of "console" window (one-based) */
int w32ConGetSize( int *width, int *height);

/* setpos (zerobased) */
int w32ConSetPos( int col, int row);

/* getpos (zerobased) */
int w32ConGetPos( int *col, int *row);

/* set/clear internal pointer to client object */
int w32ConSetClientPointer( class Client *client );

/* async (window driven) gethostbyname - return type is LPARAM */
long w32ConAsyncGetHostByName( const char *hostname, void *buf, int bufsize );

/* send one of the above IDM commands. Returns < 0 if failed. */
int w32ConSendIDMCommand( int cmd );

#endif //__W32CONS_H__
