20100716

0xac (prg05)

#language :: c/c++ (mingw)
#purpose :: alarm clock
#date :: 16072010
#author :: gerganov

Information...
*uncommented code
*winapi bloats the exe
*open source (no license)
*prevents os standby/sleep
*with command line argument
*with countdown

http://roboet.hit.bg/blog_storage/0xac.zip

#searchterms :: prevent laptop from going to sleep, prevent windows from going to sleep, stop standby, prevent standby, prevent computer from going to sleep

_getch() (prg04)

#language :: c/c++ (mingw)
#purpose :: winapi getch implement
#date :: 16072010
#author :: gerganov


TCHAR _getch()
{
         DWORD mode;
         TCHAR chr = 0;
         DWORD cnt;
         //get a handle to stdin
         HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
         //save the current input mode...
         GetConsoleMode(hStdIn,&mode);
         // Clear the mode
         // turn off ENABLE_ECHO_INPUT
         // and ENABLE_LINE_INPUT
         // so that the output will not be echoed
         // and will not pause until the end of
         // a line for input.
         SetConsoleMode(hStdIn,0);
         // Read in 1 char from the input buffer.
         ReadConsole(hStdIn,&chr,sizeof(TCHAR),&cnt,NULL);
         //restore the current input mode.
         SetConsoleMode(hStdIn, mode);
         return chr;
}

#searchterms :: winapi getch implement, readconsole getch, _getch(), getch(), press a key to continue, pause program, no echo get, get char, winapi getch, conio.h getch, winapi conio.h