Ejemplo n.º 1
0
STDMETHODIMP CPreviewPlugin::Configure(void)
{
	CConfigDlg dlg;
	dlg.DoModal();

	return S_OK;
}
Ejemplo n.º 2
0
Archivo: alarm.cpp Proyecto: bugou/test
ICQ_EXPORT void configure(IcqProfile *profile)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	CConfigDlg dlg;
	dlg.m_enable = alarmEnabled;
	dlg.m_date = alarmTime;
	dlg.m_time = alarmTime;
	dlg.m_text = alarmText.c_str();

	if (dlg.DoModal() != IDOK)
		return;

	alarmEnabled = dlg.m_enable;
	alarmTime = CTime(dlg.m_date.GetYear(), dlg.m_date.GetMonth(), dlg.m_date.GetDay(),
		dlg.m_time.GetHour(), dlg.m_time.GetMinute(), dlg.m_time.GetSecond());
	alarmText = dlg.m_text;

	profile->writeBool("enable", alarmEnabled ? true : false);
	profile->writeInt("year", alarmTime.GetYear());
	profile->writeInt("month", alarmTime.GetMonth());
	profile->writeInt("day", alarmTime.GetDay());
	profile->writeInt("hour", alarmTime.GetHour());
	profile->writeInt("minute", alarmTime.GetMinute());
	profile->writeInt("second", alarmTime.GetSecond());
	profile->writeString("text", alarmText.c_str());

	if (alarmEnabled)
		setTimer(alarmTime);
}
Ejemplo n.º 3
0
void CAnyChatVideoMixerDlg::OnButtonConfig() 
{
	CConfigDlg dlg;
	if(dlg.DoModal() == IDOK)
	{
		::EnterCriticalSection(&m_hMapSection);
		if(m_lpMixVideoBuf)
		{
			free(m_lpMixVideoBuf);
			m_lpMixVideoBuf = NULL;
		}
		m_dwMixImageSize = g_localSettings.dwWidth * g_localSettings.dwHeight * 3 / 2;
		m_lpMixVideoBuf = (CHAR*)malloc(m_dwMixImageSize);
		::LeaveCriticalSection(&m_hMapSection);

		SetLocalVideoParamters();
		// 重新设置输入格式
		BRAC_SetInputVideoFormat(BRAC_PIX_FMT_YUV420P, g_localSettings.dwWidth, g_localSettings.dwHeight, g_localSettings.dwFrameRate, 0);
	
		m_dwAudioStartTime = 0;
		m_dwAlreadInputAudioSamples = 0;
	}
}
Ejemplo n.º 4
0
INT_PTR CConfigDlg::WndProcS(HWND a_hwndDlg, UINT a_uMsg, WPARAM a_wParam, LPARAM a_lParam)
{
    switch (a_uMsg)
    {
    case WM_INITDIALOG:
        {
            CConfigDlg* pWnd = reinterpret_cast<CConfigDlg*>((LPVOID)a_lParam) ;
            if (pWnd)
            {
                s_mapDlg[a_hwndDlg] = pWnd ;
                pWnd->m_hWnd = a_hwndDlg ;
                return pWnd->WndProc(a_uMsg, a_wParam, a_lParam) ;
            }
        }
        break ;

    case WM_DESTROY:
    default:
        {
            DlgMap_t::iterator It = s_mapDlg.find(a_hwndDlg) ;
            if (It != s_mapDlg.end())
            {
                INT_PTR nResult = (*It).second->WndProc(a_uMsg, a_wParam, a_lParam) ;
                if (a_uMsg == WM_NCDESTROY)
                {
                    s_mapDlg.erase(It) ;
                }

                return nResult ;
            }
        }
        break ;
    }

    return FALSE ;
}
Ejemplo n.º 5
0
BOOL CMonitorApp::InitInstance()
{
	if (!AfxSocketInit())
	{
		AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
		return FALSE;
	}

	AfxEnableControlContainer();

	CWnd *pWnd = CWnd::FindWindow(NULL, _T("三九前置采集服务器"));
	if( pWnd != NULL )
	{
		return FALSE;
	}

#ifdef _AFXDLL
	Enable3dControls();	
#else
	Enable3dControlsStatic();
#endif

	SetRegistryKey(_T("Smart Monitor"));

    TCHAR  szModule[MAX_PATH];

	GetModuleFileName(NULL, szModule, MAX_PATH);
	for(long i=lstrlen(szModule)-1; i>=0; i--)
	{
		if( szModule[i] == '\\' )
		{
			szModule[i] = '\0' ;
			break;
		}
	}

	SetCurrentDirectory(szModule);

	lstrcpy(strCurDir, szModule);
	wsprintf(strServerINI, "%s\\SmartServer.ini", szModule);
	wsprintf(strSmartServer, "%s\\SmartServer.EXE", szModule);
	wsprintf(strSmartTemp, "%s\\SmartTemp.dat", szModule);

	if( strcmp(m_lpCmdLine, "config") )
	{
		CMainFrame* pFrame = new CMainFrame;
		m_pMainWnd = pFrame;

		pFrame->LoadFrame(IDR_MAINFRAME,
			WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
			NULL);

		m_pMainWnd->ShowWindow(SW_HIDE);
		m_pMainWnd->UpdateWindow();
	}
	else
	{
		CConfigDlg dlg;
		m_pMainWnd = &dlg;
		dlg.DoModal();

	}
	return TRUE;
}