50static BOOL CALLBACK _logdata_dialog_proc(HWND Hwnd,
UINT message,WPARAM wParam,LPARAM lParam);
51static DWORD WINAPI _logdata_thread_function(
LPVOID log_obj_ptr);
73 ThreadHandle = CreateThread(
NULL, 0, _logdata_thread_function, (
LPVOID)
this, 0, &ThreadID);
85 if (::IsWindow(
Hwnd)) {
86 SendMessage(
Hwnd, WM_CLOSE, 0, 0 );
106 va_start(arguments, text);
111 static char string_buffer[256];
113 vsprintf(string_buffer, text, args);
117 SendMessage(ctrlHwnd, EM_SETSEL, -1, -1 );
118 SendMessage(ctrlHwnd, EM_REPLACESEL,
FALSE, (
long)string_buffer);
120 last_buffer_index = buffer_index;
121 buffer_index+=strlen(string_buffer);
149 va_start(arguments, text);
156 static char string_buffer[256];
157 vsprintf(string_buffer, text, args);
161 SendMessage(ctrlHwnd, EM_SETSEL, last_buffer_index, buffer_index );
162 SendMessage(ctrlHwnd, EM_REPLACESEL,
FALSE, (
long)string_buffer);
164 buffer_index = strlen(string_buffer) + last_buffer_index;
191 pos = ((position / total) * 100.0f);
195 SendMessage(ctrlHwnd, PBM_SETPOS, pos, 0 );
214 ::EnableWindow(GetDlgItem(
Hwnd,IDOK),
TRUE);
215 ::SetForegroundWindow(
Hwnd);
245 int code = HIWORD(wParam);
268 switch (LOWORD(wParam))
301void LogDataDialogClass::Dialog_Init()
304 SetCursor(LoadCursor (
NULL, IDC_ARROW));
309 GetWindowRect(GetDesktopWindow(), &desktop);
310 GetWindowRect(
Hwnd, &ourwin);
314 sx = ourwin.right - ourwin.left;
315 sy = ourwin.bottom - ourwin.top;
317 cx = (((desktop.right - desktop.left) - sx)/2) + desktop.left;
318 cy = (((desktop.bottom - desktop.top) - sy)/2) + desktop.top;
321 SetWindowPos(
Hwnd, HWND_TOP, cx, cy, 0, 0, SWP_NOSIZE);
323 EnableWindow(GetDlgItem(
Hwnd,IDOK),
FALSE);
344BOOL CALLBACK _logdata_dialog_proc
352 if (message == WM_INITDIALOG) {
355 ::SetProp(hwnd,
"LogDataDialogClass",(HANDLE)log);
360 if (message == WM_DESTROY) {
361 ::RemoveProp(hwnd,
"LogDataDialogClass");
365 return log->
Dialog_Proc(hwnd,message,wParam,lParam);
373DWORD WINAPI _logdata_thread_function(
LPVOID log_obj_ptr)
379 (DLGPROC) _logdata_dialog_proc,
380 (LPARAM) log_obj_ptr);
LPVOID(__stdcall *SnmpUtilMemAllocPtr)(IN DWORD bytes)
bool Dialog_Proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM)
void updatebar(float position, float total)
LogDataDialogClass(HWND parent)