51 int w = LOWORD(lParam);
54 int h = HIWORD(lParam);
74 return DefWindowProc(hWnd, message, wParam, lParam);
87 if ( this->GetPromptUser() )
89 this->PromptText(text);
94 char* buffer =
new char[strlen(text)+1];
97 const char* NewLinePos = text;
102 NewLinePos = strchr(text,
'\n');
112 len = NewLinePos - text;
113 strncpy(buffer, text, len);
129 if(!Initialize() || (strlen(text) == 0))
136 (WPARAM)-1, (LPARAM)-1 );
158 if (!GetClassInfo(GetModuleHandle(
NULL),
"OutputWindow",&wndClass))
160 wndClass.style = CS_HREDRAW | CS_VREDRAW;
162 wndClass.cbClsExtra = 0;
163 wndClass.hInstance = GetModuleHandle(
NULL);
164 wndClass.hIcon = LoadIcon(
NULL, IDI_APPLICATION);
165 wndClass.hCursor = LoadCursor(
NULL, IDC_ARROW);
166 wndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
167 wndClass.lpszMenuName =
NULL;
168 wndClass.lpszClassName =
"OutputWindow";
171 wndClass.cbWndExtra = 4;
172 RegisterClass(&wndClass);
176 HWND win = CreateWindow(
177 "OutputWindow",
"OutputWindow",
178 WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
183 CREATESTRUCT lpParam;
184 lpParam.hInstance = GetModuleHandle(
NULL);
185 lpParam.hMenu =
NULL;
186 lpParam.hwndParent = win;
191 lpParam.style = ES_MULTILINE | ES_READONLY | WS_CHILD
192 | ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_VISIBLE | WS_MAXIMIZE
193 | WS_VSCROLL | WS_HSCROLL;
195 lpParam.lpszName =
"Output Control";
196 lpParam.lpszClass =
"EDIT";
197 lpParam.dwExStyle = 0;
213 const int maxsize = 5242880;
216 EM_LIMITTEXT, maxsize, 0L);
220 ShowWindow(win, SW_SHOW);
231 msg << text <<
"\nPress Cancel to supress any further messages.";
232 if (MessageBox(
NULL, msg.str().c_str(),
"Error",
233 MB_ICONERROR | MB_OKCANCEL) == IDCANCEL)