include .\http.inc ;****************************************************************************** ;***** Signal Dialog Procedure ***** ;****************************************************************************** SiganlLoggingDlgProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM LOCAL ht : DWORD LOCAL HttpThreadID : DWORD .IF uMsg==WM_INITDIALOG mov sig_exist,1 .if (LogToFile) || (LogToHttp) invoke SetTimer, hWnd, 0003, LogInterval, NULL mov ht,eax .endif invoke LoadSettings invoke SetDlgItemText, hWnd, IDC_SIGNALFILE, addr SignalFile invoke SetDlgItemText, hWnd, IDC_SIGNALHTTP, addr SignalHttp invoke SetDlgItemInt, hWnd, IDC_LOGINTERVAL, LogInterval, FALSE .if (LogToFile) invoke CheckDlgButton, hWnd, IDC_LOGTOFILE ,BST_CHECKED invoke GetDlgItem, hWnd, IDC_SIGNALFILE invoke EnableWindow, eax, TRUE .else invoke GetDlgItem, hWnd, IDC_SIGNALFILE invoke EnableWindow, eax, FALSE .endif .if (LogToHttp) invoke CheckDlgButton, hWnd, IDC_LOGTOHTTP ,BST_CHECKED invoke GetDlgItem, hWnd, IDC_SIGNALHTTP invoke EnableWindow, eax, TRUE .else invoke GetDlgItem, hWnd, IDC_SIGNALHTTP invoke EnableWindow, eax, FALSE .endif .ELSEIF uMsg==WM_CLOSE .if (LogToFile) || (LogToHttp) invoke ShowWindow, hSignalWnd, SW_HIDE .else invoke EndDialog,hWnd,00h mov sig_exist,0 .endif .ELSEIF uMsg==WM_TIMER .if (LogToHttp) invoke CreateThread, NULL, 0, addr WriteToHttp, NULL, 0, addr HttpThreadID invoke CloseHandle, eax .endif .if (LogToFile) invoke WriteToFile .endif .ELSEIF uMsg==WM_LBUTTONDOWN invoke ReleaseCapture invoke SendMessage, hWnd, WM_SYSCOMMAND, SC_MOVE or HTCAPTION, 0 .ELSEIF uMsg==WM_COMMAND mov edx, wParam shr edx, 16 .if dx==BN_CLICKED mov ecx, wParam .if cx==IDC_SIG_OK ; we should save settings xor edx,edx mov dx,BN_CLICKED shl edx, 16 xor ecx,ecx mov cx,IDC_LOGAPPLY or edx,ecx invoke SendMessage, hWnd, WM_COMMAND, edx, NULL invoke SendMessage, hWnd, WM_CLOSE, NULL, NULL .elseif cx==IDC_LOGTOFILE invoke IsDlgButtonChecked, hWnd, IDC_LOGTOFILE .if (eax==BST_CHECKED) invoke GetDlgItem, hWnd, IDC_SIGNALFILE invoke EnableWindow, eax, TRUE .else invoke GetDlgItem, hWnd, IDC_SIGNALFILE invoke EnableWindow, eax, FALSE .endif .elseif cx==IDC_LOGTOHTTP invoke IsDlgButtonChecked, hWnd, IDC_LOGTOHTTP .if (eax==BST_CHECKED) invoke GetDlgItem, hWnd, IDC_SIGNALHTTP invoke EnableWindow, eax, TRUE .else invoke GetDlgItem, hWnd, IDC_SIGNALHTTP invoke EnableWindow, eax, FALSE .endif .elseif cx==IDC_HTTPTEST invoke CreateThread, NULL, 0, addr WriteToHttp, NULL, 0, addr HttpThreadID invoke CloseHandle, eax .elseif cx==IDC_FILETEST invoke WriteToFile .elseif cx==IDC_LOGAPPLY ;saving options invoke IsDlgButtonChecked, hWnd, IDC_LOGTOFILE .if (eax==BST_CHECKED) mov LogToFile,01 .else mov LogToFile,00 .endif invoke GetDlgItemText, hWnd, IDC_SIGNALFILE, addr SignalFile, 255 invoke IsDlgButtonChecked, hWnd, IDC_LOGTOHTTP .if (eax==BST_CHECKED) mov LogToHttp,01 .else mov LogToHttp,00 .endif invoke GetDlgItemText, hWnd, IDC_SIGNALHTTP, addr SignalHttp, 255 ; applying new timer settings invoke GetDlgItemInt, hWnd, IDC_LOGINTERVAL, NULL, FALSE .if (eax) mov LogInterval,eax .endif invoke KillTimer, hWnd, ht .if (LogToHttp) || (LogToFile) invoke SetTimer, hWnd, 0003, LogInterval, NULL mov ht,eax .endif invoke SaveSettings .endif .endif .ELSE mov eax,FALSE ret .ENDIF mov eax,FALSE ret SiganlLoggingDlgProc endp