Hi,
Hope someone can help me, ive read all the faqs about the clear function. Ive gone with the windows option;
#include <windows.h>
void clrscr()
{
COORD coordScreen = { 0, 0 };
DWORD cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwConSize;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsole, &csbi);
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten);
GetConsoleScreenBufferInfo(hConsole, &csbi);
FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
SetConsoleCursorPosition(hConsole, coordScreen);
}
ive placed this at the top of my prog.
Next i want to have a "clear" button (IDC_CLEAR), which ive made, to clear a list box, called IDC_EVENTLOG.
Heres the code so far, just not sure how to link the pressing of the button to the clear function.
else if (LOWORD(wParam) == IDC_CLEAR)
{
if(MessageBoxW(hDlg, L"Are you sure you want to Clear the Event Log ?", L"Warning", MB_YESNO) == IDYES)
{
if(gStarted == TRUE)
{
//Call clear function here
gStarted = FALSE; clrscr(IDC_EVENTLOG); //HELP!!? NOT SURE????
//exit(0);
}
//SetEvent(ghExit);
//EndDialog(hDlg, LOWORD(wParam));
}
//return TRUE;
}
Sorry if this is an obvious question, but im fairly new at this!
Many Thanks for ANY help,
p