void CEpgDataCap_BonDlg::OnDestroy() { UpdateData(TRUE); this->main.StopServer(); this->main.CloseBonDriver(); KillTimer(TIMER_STATUS_UPDATE); KillTimer(RETRY_ADD_TRAY); DeleteTaskBar(GetSafeHwnd(), TRAYICON_ID); WINDOWPLACEMENT Pos; GetWindowPlacement(&Pos); CString strAdd; strAdd.Format(L"%d", Pos.rcNormalPosition.top ); WritePrivateProfileString(L"SET_WINDOW", L"top", strAdd.GetBuffer(0), this->moduleIniPath); strAdd.Format(L"%d", Pos.rcNormalPosition.left ); WritePrivateProfileString(L"SET_WINDOW", L"left", strAdd.GetBuffer(0), this->moduleIniPath); strAdd.Format(L"%d", Pos.rcNormalPosition.bottom ); WritePrivateProfileString(L"SET_WINDOW", L"bottom", strAdd.GetBuffer(0), this->moduleIniPath); strAdd.Format(L"%d", Pos.rcNormalPosition.right ); WritePrivateProfileString(L"SET_WINDOW", L"right", strAdd.GetBuffer(0), this->moduleIniPath); int selONID = -1; int selTSID = -1; int selSID = -1; CString bon = L""; this->combTuner.GetWindowText(bon); int sel = this->combService.GetCurSel(); if( sel != CB_ERR ){ DWORD index = (DWORD)this->combService.GetItemData(sel); selONID = this->serviceList[index].originalNetworkID; selTSID = this->serviceList[index].transportStreamID; selSID = this->serviceList[index].serviceID; } strAdd.Format(L"%d", selONID ); WritePrivateProfileString(L"SET", L"LastONID", strAdd.GetBuffer(0), this->moduleIniPath); strAdd.Format(L"%d", selTSID ); WritePrivateProfileString(L"SET", L"LastTSID", strAdd.GetBuffer(0), this->moduleIniPath); strAdd.Format(L"%d", selSID ); WritePrivateProfileString(L"SET", L"LastSID", strAdd.GetBuffer(0), this->moduleIniPath); WritePrivateProfileString(L"SET", L"LastBon", bon.GetBuffer(0), this->moduleIniPath); strAdd.Format(L"%d", this->chkUDP.GetCheck() ); WritePrivateProfileString(L"SET", L"ChkUDP", strAdd.GetBuffer(0), this->moduleIniPath); strAdd.Format(L"%d", this->chkTCP.GetCheck() ); WritePrivateProfileString(L"SET", L"ChkTCP", strAdd.GetBuffer(0), this->moduleIniPath); CDialogEx::OnDestroy(); // TODO: ここにメッセージ ハンドラー コードを追加します。 }
void CEpgTimerTaskDlg::OnDestroy() { KillTimer(RETRY_ADD_TRAY); KillTimer(RETRY_CHG_TRAY); DeleteTaskBar(GetSafeHwnd(), TRAYICON_ID); CSendCtrlCmd cmd; cmd.SendUnRegistGUI(GetCurrentProcessId()); CDialogEx::OnDestroy(); // TODO: ここにメッセージ ハンドラー コードを追加します。 }
void CEpgDataCap_BonDlg::OnDestroy() { this->main.StopServer(); this->main.CloseBonDriver(); KillTimer(TIMER_STATUS_UPDATE); KillTimer(RETRY_ADD_TRAY); DeleteTaskBar(GetSafeHwnd(), TRAYICON_ID); WINDOWPLACEMENT Pos; Pos.length = sizeof(WINDOWPLACEMENT); GetWindowPlacement(m_hWnd, &Pos); WritePrivateProfileInt(L"SET_WINDOW", L"top", Pos.rcNormalPosition.top, this->moduleIniPath.c_str()); WritePrivateProfileInt(L"SET_WINDOW", L"left", Pos.rcNormalPosition.left, this->moduleIniPath.c_str()); WritePrivateProfileInt(L"SET_WINDOW", L"bottom", Pos.rcNormalPosition.bottom, this->moduleIniPath.c_str()); WritePrivateProfileInt(L"SET_WINDOW", L"right", Pos.rcNormalPosition.right, this->moduleIniPath.c_str()); int selONID = -1; int selTSID = -1; int selSID = -1; WCHAR bon[512] = L""; GetWindowText(GetDlgItem(IDC_COMBO_TUNER), bon, 512); int sel = ComboBox_GetCurSel(GetDlgItem(IDC_COMBO_SERVICE)); if( sel != CB_ERR ){ DWORD index = (DWORD)ComboBox_GetItemData(GetDlgItem(IDC_COMBO_SERVICE), sel); selONID = this->serviceList[index].originalNetworkID; selTSID = this->serviceList[index].transportStreamID; selSID = this->serviceList[index].serviceID; } WritePrivateProfileInt(L"SET", L"LastONID", selONID, this->moduleIniPath.c_str()); WritePrivateProfileInt(L"SET", L"LastTSID", selTSID, this->moduleIniPath.c_str()); WritePrivateProfileInt(L"SET", L"LastSID", selSID, this->moduleIniPath.c_str()); WritePrivateProfileString(L"SET", L"LastBon", bon, this->moduleIniPath.c_str()); WritePrivateProfileInt(L"SET", L"ChkUDP", Button_GetCheck(GetDlgItem(IDC_CHECK_UDP)), this->moduleIniPath.c_str()); WritePrivateProfileInt(L"SET", L"ChkTCP", Button_GetCheck(GetDlgItem(IDC_CHECK_TCP)), this->moduleIniPath.c_str()); // TODO: ここにメッセージ ハンドラー コードを追加します。 }
LRESULT CEpgDataCap_BonDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { // TODO: ここに特定なコードを追加するか、もしくは基本クラスを呼び出してください。 switch(message){ case WM_RESERVE_REC_START: { BtnUpdate(GUI_OTHER_CTRL); if( this->log.Find(L"予約録画中") < 0 ){ this->log = L"予約録画中\r\n"; SetDlgItemText(IDC_EDIT_LOG, this->log); } ChgIconStatus(); } break; case WM_RESERVE_REC_STOP: { BtnUpdate(GUI_NORMAL); this->log = L"予約録画終了しました\r\n"; SetDlgItemText(IDC_EDIT_LOG, this->log); ChgIconStatus(); } break; case WM_RESERVE_EPGCAP_START: { SetTimer(TIMER_EPGCAP_STATSU, 1000, NULL); BtnUpdate(GUI_CANCEL_ONLY); ChgIconStatus(); } break; case WM_RESERVE_EPGCAP_STOP: { ChgIconStatus(); } break; case WM_CHG_TUNER: { wstring bonDriver = L""; this->main.GetOpenBonDriver(&bonDriver); this->iniBonDriver = bonDriver.c_str(); ReloadBonDriver(); ChgIconStatus(); } break; case WM_CHG_CH: { WORD ONID; WORD TSID; WORD SID; this->main.GetCh(&ONID, &TSID, &SID); this->initONID = ONID; this->initTSID = TSID; this->initSID = SID; ReloadServiceList(); ChgIconStatus(); } break; case WM_RESERVE_REC_STANDBY: { if( wParam == 1 ){ BtnUpdate(GUI_REC_STANDBY); this->log = L"予約録画待機中\r\n"; SetDlgItemText(IDC_EDIT_LOG, this->log); }else if( wParam == 2 ){ BtnUpdate(GUI_NORMAL); this->log = L"視聴モード\r\n"; SetDlgItemText(IDC_EDIT_LOG, this->log); }else{ BtnUpdate(GUI_NORMAL); this->log = L""; SetDlgItemText(IDC_EDIT_LOG, this->log); } } break; case WM_TRAY_PUSHICON: { //タスクトレイ関係 switch(LOWORD(lParam)){ case WM_LBUTTONDOWN: { this->iniMin = FALSE; ShowWindow(SW_RESTORE); SetForegroundWindow(); KillTimer(RETRY_ADD_TRAY); DeleteTaskBar(GetSafeHwnd(), TRAYICON_ID); } break ; default : break ; } } break; default: break; } return CDialogEx::WindowProc(message, wParam, lParam); }