//## begin module.cm preserve=no // %X% %Q% %Z% %W% //## end module.cm //## begin module.cp preserve=no //## end module.cp //## Module: NTConsole; Pseudo Package body //## Subsystem: lab7 //## Source file: H:\kurs\avC++\lab7\NTConsle.cpp //## begin module.additionalIncludes preserve=no //## end module.additionalIncludes //## begin module.includes preserve=yes //## end module.includes // NTConsole #include "NTConsle.h" //## begin module.additionalDeclarations preserve=yes #include #include //## end module.additionalDeclarations // Class NTConsole NTConsole::NTConsole() //## begin NTConsole::NTConsole%.hasinit preserve=no //## end NTConsole::NTConsole%.hasinit //## begin NTConsole::NTConsole%.initialization preserve=yes //## end NTConsole::NTConsole%.initialization { //## begin NTConsole::NTConsole%.body preserve=yes //## end NTConsole::NTConsole%.body } NTConsole::~NTConsole() { //## begin NTConsole::~NTConsole%.body preserve=yes //## end NTConsole::~NTConsole%.body } //## Other Operations (implementation) void NTConsole::drawWindow (int xpos, int ypos, int width, int height, char* name) { //## begin NTConsole::drawWindow%940929802.body preserve=yes HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); COORD ul; char buff[] = " "; LPVOID param; DWORD written=0; ul.X = xpos; ul.Y = ypos; SetConsoleCursorPosition(h,ul); SetConsoleTextAttribute(h,FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_INTENSITY|BACKGROUND_BLUE|BACKGROUND_INTENSITY); // Print "titlebar" WriteConsole(h,buff,strlen(buff),&written,param); WriteConsole(h,name,strlen(name),&written,param); for(int j=0; j<(width-strlen(name)-1); j++) WriteConsole(h,buff,strlen(buff),&written,param); // Print the rest if the window SetConsoleTextAttribute(h,FOREGROUND_BLUE|FOREGROUND_INTENSITY|BACKGROUND_BLUE|BACKGROUND_GREEN|BACKGROUND_RED); for(int i=1; i