Ejemplo n.º 1
0
//CMD2_TIMER_GUI_SRV_STATUS_NOTIFY2 サーバーのステータス変更通知
void CEpgTimerTaskDlg::CmdSrvStatusChg(CMD_STREAM* pCmdParam, CMD_STREAM* pResParam)
{
	OutputDebugString(L"CEpgTimerTaskDlg::CmdSrvStatusChg");
	WORD ver = 0;
	DWORD readSize = 0;
	ReadVALUE2(CMD_VER, &ver, pCmdParam->data, pCmdParam->dataSize, &readSize);
	NOTIFY_SRV_INFO status;
	if( ReadVALUE2(ver, &status, pCmdParam->data+readSize, pCmdParam->dataSize-readSize, NULL) == TRUE ){
		switch(status.notifyID){
		case NOTIFY_UPDATE_SRV_STATUS:
			{
				CString strBuff = L"";
				HICON hSetIcon = m_hIconBlue;
				switch(status.param1){
					case 1:
						hSetIcon = m_hIconRed;
						break;
					case 2:
						hSetIcon = m_hIconGreen;
						break;
					default:
						break;
				}
				m_dwSrvStatus = status.param1;
				if( ChgTipsTaskBar( GetSafeHwnd(),
						TRAYICON_ID,
						hSetIcon,
						strBuff ) == FALSE ){
							SetTimer(RETRY_CHG_TRAY, 5000, NULL);
				}
			}
			break;
		default:
			break;
		}
		pResParam->param = CMD_SUCCESS;
	}else{
		pResParam->param = CMD_ERR;
	}
}
Ejemplo n.º 2
0
void CEpgDataCap_BonDlg::ChgIconStatus(){
	if( this->minTask == TRUE){
		CString buff=L"";
		wstring bonFile = L"";
		this->main.GetOpenBonDriver(&bonFile);
		CString strBuff2=L"";
		this->combService.GetWindowText(strBuff2);
		buff.Format(L"%s : %s", bonFile.c_str(), strBuff2.GetBuffer(0));

		HICON setIcon = this->iconBlue;
		if( this->main.IsRec() == TRUE ){
			setIcon = this->iconRed;
		}else if( this->main.GetEpgCapStatus(NULL) == ST_WORKING ){
			setIcon = this->iconGreen;
		}else if( this->main.GetOpenBonDriver(NULL) == FALSE ){
			setIcon = this->iconGray;
		}

		ChgTipsTaskBar( GetSafeHwnd(),
				TRAYICON_ID,
				setIcon,
				buff );
	}
}
Ejemplo n.º 3
0
void CEpgDataCap_BonDlg::ChgIconStatus(){
	if( this->minTask == TRUE){
		wstring buff=L"";
		wstring bonFile = L"";
		this->main.GetOpenBonDriver(&bonFile);
		WCHAR szBuff2[256]=L"";
		GetWindowText(GetDlgItem(IDC_COMBO_SERVICE), szBuff2, 256);
		Format(buff, L"%s : %s", bonFile.c_str(), szBuff2);

		HICON setIcon = this->iconBlue;
		if( this->main.IsRec() == TRUE ){
			setIcon = this->iconRed;
		}else if( this->main.GetEpgCapStatus(NULL) == ST_WORKING ){
			setIcon = this->iconGreen;
		}else if( this->main.GetOpenBonDriver(NULL) == FALSE ){
			setIcon = this->iconGray;
		}

		ChgTipsTaskBar( GetSafeHwnd(),
				TRAYICON_ID,
				setIcon,
				buff );
	}
}
Ejemplo n.º 4
0
void CEpgTimerTaskDlg::OnTimer(UINT_PTR nIDEvent)
{
	// TODO: ここにメッセージ ハンドラー コードを追加するか、既定の処理を呼び出します。
	if( nIDEvent == RETRY_ADD_TRAY ){
		KillTimer(RETRY_ADD_TRAY);
		CString strBuff=L"";
/*		RESERVE_DATA Item;
		if( GetNextReserve(&Item) == TRUE ){
			wstring strTime;
			GetTimeString3(Item.StartTime, Item.dwDurationSec, strTime);

			strBuff += L"次の予約 ";
			strBuff += strTime.c_str();
			strBuff += L" ";
			strBuff += Item.strTitle.c_str();
		}else{
			strBuff += L"次の予約 なし";
		}*/
		HICON hSetIcon = m_hIconBlue;
		switch(m_dwSrvStatus){
			case 1:
				hSetIcon = m_hIconRed;
				break;
			case 2:
				hSetIcon = m_hIconGreen;
				break;
			default:
				break;
		}
		if( AddTaskBar( GetSafeHwnd(),
				WM_TRAY_PUSHICON,
				TRAYICON_ID,
				hSetIcon,
				strBuff ) == FALSE ){
					SetTimer(RETRY_ADD_TRAY, 5000, NULL);
		}
	}else if( nIDEvent == RETRY_CHG_TRAY ){
		KillTimer(RETRY_CHG_TRAY);
		CString strBuff=L"";
/*		RESERVE_DATA Item;
		if( GetNextReserve(&Item) == TRUE ){
			wstring strTime;
			GetTimeString3(Item.StartTime, Item.dwDurationSec, strTime);

			strBuff += L"次の予約 ";
			strBuff += strTime.c_str();
			strBuff += L" ";
			strBuff += Item.strTitle.c_str();
		}else{
			strBuff += L"次の予約 なし";
		}
*/
		HICON hSetIcon = m_hIconBlue;
		switch(m_dwSrvStatus){
			case 1:
				hSetIcon = m_hIconRed;
				break;
			case 2:
				hSetIcon = m_hIconGreen;
				break;
			default:
				break;
		}
		if( ChgTipsTaskBar( GetSafeHwnd(),
				TRAYICON_ID,
				hSetIcon,
				strBuff ) == FALSE ){
					SetTimer(RETRY_CHG_TRAY, 5000, NULL);
		}
	}
	CDialogEx::OnTimer(nIDEvent);
}