Ejemplo n.º 1
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	m_EditMsg.Attach(GetDlgItem(IDC_EDTMSG));
	m_ListLog.Attach(GetDlgItem(IDC_LISTLOG));

	m_EditMsg.SetWindowText(TEXT("在此输入消息..."));

	pipe_driver_ = new CPipeDriver;
	pipe_handler_ = new MyPipeMessageHandler(&m_ListLog);


	return TRUE;
}
Ejemplo n.º 2
0
LRESULT CLoginDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

    HWND hWnd = GetDlgItem(IDC_GIF1);
    if (hWnd)
    {
        m_gifLogo.SubclassWindow(hWnd);
        if (m_gifLogo.Load(MAKEINTRESOURCE(IDR_GIF1),_T("GIF")))
            m_gifLogo.Draw();
    }

	return TRUE;
}
Ejemplo n.º 3
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	//读配置必须在最开始
	ReadSysIni();
	InitControl();
	SetButtonIco();
	UpdateExe();
	return TRUE;
}
Ejemplo n.º 4
0
LRESULT CMainDlg::OnInitDialog(
    UINT /*uMsg*/, WPARAM /*wParam*/, 
    LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    // center the dialog on the screen
    MoveWindow(0, 0, 1024, 768);
    CenterWindow();

    // set icons
    //HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
    //    IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
    //SetIcon(hIcon, TRUE);
    //HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
    //    IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
    //SetIcon(hIconSmall, FALSE);

    // register object for message filtering and idle updates
    CMessageLoop* pLoop = _Module.GetMessageLoop();
    ATLASSERT(pLoop != NULL);
    pLoop->AddMessageFilter(this);
    pLoop->AddIdleHandler(this);

    UIAddChildWindowContainer(m_hWnd);

    Init();
    InitPlayer();
    return TRUE;
}
Ejemplo n.º 5
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	ctl_info_.Attach(GetDlgItem(IDC_LST_INFO));

	SetDlgItemInt(IDC_TXT_LEVEL, -100, TRUE);
	SetDlgItemInt(IDC_TXT_SCALER, -100, TRUE);

	SetTimer(TIMER_ID_VOLINFO, 2000, 0);

	return TRUE;
}
Ejemplo n.º 6
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/,
                               LPARAM /*lParam*/, BOOL& /*bHandled*/) {
  // center the dialog on the screen
  CenterWindow();

  // set icons
  HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR,
                                 ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
  SetIcon(hIcon, TRUE);
  HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR,
                                      ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
  SetIcon(hIconSmall, FALSE);

  // register object for message filtering and idle updates
  CMessageLoop* pLoop = _Module.GetMessageLoop();
  ATLASSERT(pLoop != NULL);
  pLoop->AddMessageFilter(this);
  pLoop->AddIdleHandler(this);

  UIAddChildWindowContainer(m_hWnd);

  SetDlgItemText(IDC_EDT_SOURCE, _T("c:\\audio\\ave_maria.wav"));
  SetDlgItemText(IDC_EDT_DEST, _T("f:\\temp\\im\\ave_maria.aac"));
  return TRUE;
}
Ejemplo n.º 7
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);

	// 托盘图标
	trayIcon.Create(this, (sysCn) ? IDR_TRAYPOPUPCN : IDR_TRAYPOPUPEN,
		GetLocalWStr(strTrayOpenMainForm), //L"打开主界面",
		GetLocalWStr(strTrayTaiyiStarting), //L"太一运行中...",
		L"",
		1, CTrayNotifyIcon::None, hIcon, WM_TRAYNOTIFY,
		0, TRUE, FALSE, FALSE, NULL, FALSE, TRUE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	// 设置时钟,检测服务线程退出
	SetTimer(1, 100);
	SetTimer(2, 10000);
	SetMsgHandled(false);

	return TRUE;
}
Ejemplo n.º 8
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	//int cxScreen,cyScreen;
	//cxScreen = GetSystemMetrics(SM_CXSCREEN);
	//cyScreen = GetSystemMetrics(SM_CYSCREEN);
	//SetWindowPos(::GetForegroundWindow(), 0, 0, cxScreen, cyScreen, SWP_SHOWWINDOW);
	//SetWindowPos(::GetForegroundWindow(),0,0,0,0,SWP_SHOWWINDOW);
	::SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW);

	return TRUE;
}
Ejemplo n.º 9
0
LRESULT [!output WTL_MAINDLG_CLASS]::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_toolTip.Create(m_hWnd);
//{{WTLBUILDER_MEMBER_CREATION
//}}WTLBUILDER_MEMBER_CREATION

//{{WTLBUILDER_POST_CREATION
//}}WTLBUILDER_POST_CREATION

//{{WTLBUILDER_TABSTOP
//}}WTLBUILDER_TABSTOP

	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	return TRUE;
}
Ejemplo n.º 10
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	TCHAR szPath[MAX_PATH] = {0};
	GetModuleFileName(NULL, szPath, MAX_PATH);
	PathRemoveFileSpec(szPath);
	PathRemoveFileSpec(szPath);
	PathCombine(szPath, szPath, L"Res");
	strLargeImage = szPath;
	strSmallImage = szPath;
	strLargeImage += L"\\LargeImages\\%d.bmp";
	strSmallImage += L"\\SmallImages\\%d.bmp";
	return TRUE;
}
Ejemplo n.º 11
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);
	HMENU hMenu = (HMENU)::LoadMenu(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME));
	SetMenu(hMenu);
	SetDlgItemTextW(IDC_STATIC, preview_text);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	return TRUE;
}
Ejemplo n.º 12
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	DoDataExchange(false);
	// center the dialog on the screen
	CenterWindow();

	// set icons
	//HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	//SetIcon(hIcon, TRUE);
	//HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	//SetIcon(hIconSmall, FALSE);

	//CRect rcCombox;
	//m_cbxVKey1.GetDroppedControlRect(rcCombox);
	//rcCombox.bottom += 100;
	
	CRect rcCmbWindow;
	m_cbxVKey1.GetWindowRect(rcCmbWindow);
	this->ScreenToClient(rcCmbWindow);
	rcCmbWindow.bottom = rcCmbWindow.top + 200;
	m_cbxVKey1.MoveWindow(rcCmbWindow);

	for( int i = 0; i < 10; i++ )
	{
		CString strInfo;
		strInfo.Format(TEXT("String%d"), i);
		m_cbxVKey1.InsertString(-1, strInfo);
	}
    m_cbxVKey1.SetCurSel(0);
    m_cbxVKey1.Initialize();

    
	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	return TRUE;
}
Ejemplo n.º 13
0
LRESULT CPictureSettingDlg::OnInitDialog( UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/ )
{
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);
	UIAddChildWindowContainer(m_hWnd);

	m_channelNameEdit = GetDlgItem(IDC_EDIT_CHANNELNAME);
	m_channelNameEdit.EnableWindow(FALSE);
	GetDlgItem(IDC_CHECK_OSDNAME).EnableWindow(FALSE);
	GetDlgItem(IDC_CHECK_OSDTIME).EnableWindow(FALSE);

	initList();
	m_previewDlg.Create(m_hWnd,0);
	m_previewDlg.SetWindowPos(NULL,200,15,264,216,SWP_SHOWWINDOW);


	return true;
}
Ejemplo n.º 14
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

  SetWindowLong(GWL_EXSTYLE, WS_EX_TOPMOST | WS_EX_LAYERED);

  SetLayeredWindowAttributes(m_hWnd, RGB(255, 0, 255), 220, LWA_COLORKEY | LWA_ALPHA);


  RECT rect;
  GetWindowRect(&rect);
  int w = rect.right - rect.left;
  int h = rect.bottom - rect.top;

  ::GetWindowRect(GetDesktopWindow(), &rect);
  int width = rect.right - rect.left; // GetSystemMetrics(SM_CXFULLSCREEN);
  int height = rect.bottom - rect.top; // GetSystemMetrics(SM_CYFULLSCREEN);
  height -= 40;  // taskbar height

  SetWindowPos(HWND_TOPMOST, width - w, height - h, w, h, SWP_SHOWWINDOW);

  SetTimer(kTimerID, kTimerInterval, 0);
  SetTimer(kIconTimerID, kIconTimerInterval, 0);

	return TRUE;
}
Ejemplo n.º 15
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);
	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);
	UIAddChildWindowContainer(m_hWnd);


	initValue();
	LoadSetting();
	InitDB();
	initPreviewDlg();
	initDH();
	initBottomButton();
	initTimeLabel();
	initSlide();
	initCradleButton();
	//默认选中channel 0
	FocusChannel(0);
	//默认布局
	SetPreviewDlgLayout(PREVIEWLAYOUT4,0);
	//计时器 时钟
	SetTimer(1,1000);
	//录像
	SetTimer(2,1000);
	SetWindowPos(NULL,0,0,1000,700,SWP_SHOWWINDOW);
	CenterWindow();

	RegisterStreamDirectReadCallback(StreamDirectReadCallback, this);
	updateSetting();
	return TRUE;
}
Ejemplo n.º 16
0
LRESULT CWebinosUI::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	SetWindowText(PRODUCT_NAME);

	Initialise();

	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	// Initialise tray icon
	ZeroMemory(&m_trayIcon, sizeof(NOTIFYICONDATA));
	m_trayIcon.cbSize = sizeof(NOTIFYICONDATA);  
	m_trayIcon.hWnd = m_hWnd;
	m_trayIcon.uID = ID_TRAY_APP_ICON;
	m_trayIcon.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP | NIF_INFO;
	m_trayIcon.uCallbackMessage = WM_WEBINOS_TRAY_ICON; 
	m_trayIcon.hIcon = hIconSmall;
	_tcscpy_s(m_trayIcon.szTip, _countof(m_trayIcon.szTip), PRODUCT_NAME);
	_tcscpy_s(m_trayIcon.szInfo, _countof(m_trayIcon.szInfo), (LPCTSTR)(CString(PRODUCT_NAME) + CString(" is running - double-click icon for options")));
	_tcscpy_s(m_trayIcon.szInfoTitle, _countof(m_trayIcon.szInfoTitle), (LPCTSTR)(CString(PRODUCT_NAME) + CString(" status")));
	Shell_NotifyIcon(NIM_ADD, &m_trayIcon);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	return TRUE;
}
LRESULT CProcessorUsageDialog::OnInitDialog( UINT /*uMsg*/, 
                                             WPARAM /*wParam*/, 
                                             LPARAM /*lParam*/, 
                                             BOOL& bHandled )
{
    HWND hMenuBar = CreateMenuBar( ATL_IDM_MENU_DONECANCEL );
    UIAddToolBar( hMenuBar );
    UIAddChildWindowContainer( m_hWnd );

    // register object for message filtering and idle updates
    CMessageLoop* pLoop = _Module.GetMessageLoop();
    ATLASSERT( pLoop != NULL );
    pLoop->AddMessageFilter( this );
    pLoop->AddIdleHandler( this );

    DoDataExchange( FALSE );

    process_list_ctrl_.AddColumn( L"Process", 0 );
    process_list_ctrl_.AddColumn( L"User", 1 );
    process_list_ctrl_.AddColumn( L"Kernel", 2 );
    process_list_ctrl_.SetExtendedListViewStyle( LVS_EX_DOUBLEBUFFER | 
                                                 LVS_EX_FULLROWSELECT );

    CRect list_rc;
    process_list_ctrl_.GetClientRect( &list_rc );

    process_list_ctrl_.SetColumnWidth( 0, 
        static_cast< int >( list_rc.Width() * 0.5 ) );
    process_list_ctrl_.SetColumnWidth( 1, 
        static_cast< int >( list_rc.Width() * 0.25 ) );
    process_list_ctrl_.SetColumnWidth( 2, LVSCW_AUTOSIZE_USEHEADER );

    meter_.Start( boost::bind( 
        &CProcessorUsageDialog::OnUsageUpdate, this, _1, _2 ), 3000 );

    return bHandled = FALSE;
}
Ejemplo n.º 18
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON));
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON));
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);


	UIAddChildWindowContainer(m_hWnd);

	//SendMessage(::GetDlgItem(m_hWnd, IDC_COMBO_TYPE), CB_RESETCONTENT, 0, 0);
	//SendMessage(::GetDlgItem(m_hWnd, IDC_COMBO_TYPE), CB_SETCURSEL, 0, 1);
	return TRUE;
}
Ejemplo n.º 19
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	DlgResize_Init();
	// center the dialog on the screen
	CenterWindow();

	sAppTooltip="MtConnectDboard";
	nIcon=0;

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	//CMessageLoop* pLoop = _Module.GetMessageLoop();
	CMessageLoop* pLoop = _thread->GetMessageLoop();
	
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	// Remove Max/Min buttons - if using TrayIcon
	DWORD style = ::GetWindowLong(this->m_hWnd, GWL_STYLE);
	style &= ~(WS_MAXIMIZEBOX); // WS_MINIMIZEBOX NOT WS_THICKFRAME
	::SetWindowLong(this->m_hWnd, GWL_STYLE, style);

	// Install tray icon
	hSmileyIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME));
	hIdleIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_IDLEICON));
	hStopIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_STOPICON));
	hClearIcon = LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_CLEARICON));
	InstallIcon(sAppTooltip, hSmileyIcon, IDR_MENU1);

	CAxWindow wndIE = GetDlgItem(IDC_EXPLORER1);
	HRESULT hr;
	hr = wndIE.QueryControl ( &m_spWebBrowser );

	if ( m_spWebBrowser )
	{
		CComVariant v;  // empty variant
		m_spWebBrowser->Navigate ( CComBSTR("about:blank"), 
			&v, &v, &v, &v );
	}
	//Handle NavigateComplete2 event from the browser, get the document  element, call DispEventAdvise(pDocument). onclick event bubbles, so you  can handle it on the document and get clicks from all contained  elements.
	//DispEventAdvise(m_spWebBrowser); 

	//Then you need to register your interface to be used proccess wide:
	hr = pGIT->RegisterInterfaceInGlobal( (IUnknown*)(IWebBrowser2*)m_spWebBrowser, IID_IWebBrowser2, &dwWebBrowserCookie);

	//std::string html = MTConnectStreamsParser().CreateHtmlDocument();
	//CHtmlTableSnapshots().SetDocumentText(m_spWebBrowser,html);


	// Icon mapping
	std::vector<HICON> icons(2);
	icons[0]=hSmileyIcon; icons[1]=hClearIcon;	StateIconMap["EXECUTING"] = icons; // flashing green
	icons[0]=hSmileyIcon; icons[1]=hSmileyIcon;	StateIconMap["IDLE"] = icons; // idle auto
	icons[0]=hStopIcon;    icons[1]=hStopIcon;	StateIconMap["STOPPED"] = icons; // stopped
	icons[0]=hStopIcon;    icons[1]=hClearIcon;	StateIconMap["FAULT"] = icons; // stopped fault

	this->SetTimer(1, 250); 

	dlgMainThead = ::GetCurrentThread();
	return TRUE;
}
Ejemplo n.º 20
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{   
  CString sRTL = Utility::GetINIString(_T("Settings"), _T("RTLReading"));
  if(sRTL.CompareNoCase(_T("1"))==0)
  {
    Utility::SetLayoutRTL(m_hWnd);
  }

  SetWindowText(Utility::GetINIString(_T("MainDlg"), _T("DlgCaption")));

	// center the dialog on the screen
	CenterWindow();
	
  // Set window icon
  SetIcon(::LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME)), 0);

  // Load heading icon
  HMODULE hExeModule = LoadLibrary(g_CrashInfo.m_sImageName);
  if(hExeModule)
  {
    // Use IDR_MAINFRAME icon which is the default one for the crashed application.
    m_HeadingIcon = ::LoadIcon(hExeModule, MAKEINTRESOURCE(IDR_MAINFRAME));
  }  

  // If there is no IDR_MAINFRAME icon in crashed EXE module, use IDI_APPLICATION system icon
  if(m_HeadingIcon == NULL)
  {
    m_HeadingIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION));
  }  

  CStatic statSubHeader = GetDlgItem(IDC_SUBHEADER);
  statSubHeader.SetWindowText(Utility::GetINIString(_T("MainDlg"), _T("SubHeaderText")));
 
  m_link.SubclassWindow(GetDlgItem(IDC_LINK));   
  m_link.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);
  m_link.SetLabel(Utility::GetINIString(_T("MainDlg"), _T("WhatDoesReportContain")));
  
  m_linkMoreInfo.SubclassWindow(GetDlgItem(IDC_MOREINFO));
  m_linkMoreInfo.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);
  m_linkMoreInfo.SetLabel(Utility::GetINIString(_T("MainDlg"), _T("ProvideAdditionalInfo")));
  
  m_statEmail = GetDlgItem(IDC_STATMAIL);
  m_statEmail.SetWindowText(Utility::GetINIString(_T("MainDlg"), _T("YourEmail")));

  m_editEmail = GetDlgItem(IDC_EMAIL);
  
  m_statDesc = GetDlgItem(IDC_DESCRIBE);
  m_statDesc.SetWindowText(Utility::GetINIString(_T("MainDlg"), _T("DescribeProblem")));

  m_editDesc = GetDlgItem(IDC_DESCRIPTION);

  m_statIndent =  GetDlgItem(IDC_INDENT);
  
  m_statConsent = GetDlgItem(IDC_CONSENT);

  LOGFONT lf;
  memset(&lf, 0, sizeof(LOGFONT));
  lf.lfHeight = 11;
  lf.lfWeight = FW_NORMAL;
  lf.lfQuality = ANTIALIASED_QUALITY;
  _TCSCPY_S(lf.lfFaceName, 32, _T("Tahoma"));
  CFontHandle hConsentFont;
  hConsentFont.CreateFontIndirect(&lf);
  m_statConsent.SetFont(hConsentFont);

  if(g_CrashInfo.m_sPrivacyPolicyURL.IsEmpty())
    m_statConsent.SetWindowText(Utility::GetINIString(_T("MainDlg"), _T("MyConsent2")));
  else
    m_statConsent.SetWindowText(Utility::GetINIString(_T("MainDlg"), _T("MyConsent")));

  m_linkPrivacyPolicy.SubclassWindow(GetDlgItem(IDC_PRIVACYPOLICY));
  m_linkPrivacyPolicy.SetHyperLink(g_CrashInfo.m_sPrivacyPolicyURL);
  m_linkPrivacyPolicy.SetLabel(Utility::GetINIString(_T("MainDlg"), _T("PrivacyPolicy")));
  
  BOOL bShowPrivacyPolicy = !g_CrashInfo.m_sPrivacyPolicyURL.IsEmpty();  
  m_linkPrivacyPolicy.ShowWindow(bShowPrivacyPolicy?SW_SHOW:SW_HIDE);
  
  m_statCrashRpt = GetDlgItem(IDC_CRASHRPT);
  m_statHorzLine = GetDlgItem(IDC_HORZLINE);  

  m_btnOk = GetDlgItem(IDOK);
  m_btnOk.SetWindowText(Utility::GetINIString(_T("MainDlg"), _T("SendReport")));

  m_btnCancel = GetDlgItem(IDCANCEL);
  m_btnCancel.SetWindowText(Utility::GetINIString(_T("MainDlg"), _T("CloseTheProgram")));

  CRect rc1, rc2, rc3, rc4;
  m_editEmail.GetWindowRect(&rc1);
  m_statConsent.GetWindowRect(&rc2);
  m_nDeltaY = rc2.top-rc1.top;
  m_linkPrivacyPolicy.GetWindowRect(&rc3);
  m_statCrashRpt.GetWindowRect(&rc4);
  m_nDeltaY2 = rc4.top-rc3.top;
  
  memset(&lf, 0, sizeof(LOGFONT));
  lf.lfHeight = 25;
  lf.lfWeight = FW_NORMAL;
  lf.lfQuality = ANTIALIASED_QUALITY;
  _TCSCPY_S(lf.lfFaceName, 32, _T("Tahoma"));
  m_HeadingFont.CreateFontIndirect(&lf);

  ShowMoreInfo(FALSE);

  m_dlgProgress.Create(m_hWnd);
  m_dlgProgress.Start(TRUE);

  DWORD dwThreadId = 0;
  m_hSenderThread = CreateThread(NULL, 0, CollectorThread, (LPVOID)&m_ctx, 0, &dwThreadId);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	return TRUE;
}
Ejemplo n.º 21
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	idTimer = 0;
	picWidth = 4.0;
	picHeight = 3.0;
	picInchOrMM = 0; // inches
	memset(picFileName, 0, sizeof(picFileName));

	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	btnPlay = GetDlgItem(IDC_PLAY);
	btnStop = GetDlgItem(IDC_STOP);
	btnLoop = GetDlgItem(IDC_LOOP);
	RECT btnrc;
	btnPlay.GetClientRect(&btnrc);
	int cxy;
	if ((btnrc.bottom - btnrc.top) < 30)
		cxy = 16;
	else
		cxy = 32;
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_PLAY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnPlay.SetIcon(hIcon);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStop.SetIcon(hIcon);
	btnStop.EnableWindow(FALSE);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_LOOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnLoop.SetIcon(hIcon);

	CButton btnStyle = GetDlgItem(IDC_SAWTOOTH);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_SAW), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SQUARE);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_SQUARE), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SIN);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_SIN), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_RAMP);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_RAMP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_COPYCLIP);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_COPY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SAVEPIC);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_DISK), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SAVEWAV);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_WVFILE), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_HELP2);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_HELP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	pitchEd = GetDlgItem(IDC_PITCH);
	pitchEd.SetWindowText("48");

	for (int ndx = 0; ndx < WFI_MAXPART; ndx++)
	{
		sliders[ndx] = GetDlgItem(IDC_PART1+ndx);
		sliders[ndx].SetRange(0, 200, FALSE);
		sliders[ndx].SetTicFreq(20);
		sliders[ndx].SetLineSize(1);
		sliders[ndx].SetPageSize(10);
		levels[ndx] = GetDlgItem(IDC_LVL1+ndx);
	}

	SetDlgItemInt(IDC_PERIODS, 1);

	RECT rcPlot;
	CWindow frm = GetDlgItem(IDC_WVFRAME);
	frm.GetClientRect(&rcPlot);
	frm.MapWindowPoints(m_hWnd, &rcPlot);
	InflateRect(&rcPlot, -2, -2);
	wndPlot.Create(m_hWnd, rcPlot, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_BORDER, 0/*WS_EX_CLIENTEDGE*/);
	frm.ShowWindow(SW_HIDE);

	gibbs = FALSE;
	BOOL dummy;
	OnSin(0, IDC_SIN, btnStyle, dummy);

	return TRUE;
}
Ejemplo n.º 22
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	gen1Frq = GetDlgItem(IDC_CAR_FREQ);
	gen1Atk = GetDlgItem(IDC_CAR_ATTACK);
	gen1Dec = GetDlgItem(IDC_CAR_DECAY);
	gen1Vol = GetDlgItem(IDC_CAR_VOLUME);
	gen1Sus = GetDlgItem(IDC_CAR_SUSTAIN);
	gen1Rel = GetDlgItem(IDC_CAR_RELEASE);
	gen1FrqEd = GetDlgItem(IDC_CFRQ_EDIT);
	gen1AtkEd = GetDlgItem(IDC_CATK_EDIT);
	gen1DecEd = GetDlgItem(IDC_CDEC_EDIT);
	gen1VolEd = GetDlgItem(IDC_CVOL_EDIT);
	gen1SusEd = GetDlgItem(IDC_CSUS_EDIT);
	gen1RelEd = GetDlgItem(IDC_CREL_EDIT);

	InitValue(gen1Frq, gen1FrqEd, 0, 120, 12);
	PutSetting(gen1Frq, gen1FrqEd, 48.0, 1, 120);
	InitValue(gen1Vol, gen1VolEd, 0, 100, 10);
	InitValue(gen1Sus, gen1SusEd, 0, 100, 10);
	InitValue(gen1Atk, gen1AtkEd, 0, 4000, 400);
	InitValue(gen1Dec, gen1DecEd, 0, 4000, 400);
	InitValue(gen1Rel, gen1RelEd, 0, 4000, 400);

	gen2Mul = GetDlgItem(IDC_MOD1_MULT);
	gen2Ndx = GetDlgItem(IDC_MOD1_START);
	gen2Atk = GetDlgItem(IDC_MOD1_ATTACK);
	gen2Pck = GetDlgItem(IDC_MOD1_PEAK);
	gen2Dec = GetDlgItem(IDC_MOD1_DECAY);
	gen2Sus = GetDlgItem(IDC_MOD1_SUSTAIN);
	gen2Rel = GetDlgItem(IDC_MOD1_RELEASE);
	gen2End = GetDlgItem(IDC_MOD1_END);
	gen2MulEd = GetDlgItem(IDC_M1M_EDIT);
	gen2NdxEd = GetDlgItem(IDC_M1I_EDIT);
	gen2AtkEd = GetDlgItem(IDC_M1A_EDIT);
	gen2PckEd = GetDlgItem(IDC_M1P_EDIT);
	gen2DecEd = GetDlgItem(IDC_M1D_EDIT);
	gen2SusEd = GetDlgItem(IDC_M1S_EDIT);
	gen2RelEd = GetDlgItem(IDC_M1R_EDIT);
	gen2EndEd = GetDlgItem(IDC_M1E_EDIT);

	InitValue(gen2Mul, gen2MulEd, 0,  100,  10);
	InitValue(gen2Ndx, gen2NdxEd, 0,  500,  50);
	InitValue(gen2Pck, gen2PckEd, 0,  500,  50);
	InitValue(gen2Sus, gen2SusEd, 0,  500,  50);
	InitValue(gen2End, gen2EndEd, 0,  500,  50);
	InitValue(gen2Atk, gen2AtkEd, 0, 4000, 400);
	InitValue(gen2Dec, gen2DecEd, 0, 4000, 400);
	InitValue(gen2Rel, gen2RelEd, 0, 4000, 400);

	gen3Mul = GetDlgItem(IDC_MOD2_MULT);
	gen3Ndx = GetDlgItem(IDC_MOD2_START);
	gen3Atk = GetDlgItem(IDC_MOD2_ATTACK);
	gen3Pck = GetDlgItem(IDC_MOD2_PEAK);
	gen3Dec = GetDlgItem(IDC_MOD2_DECAY);
	gen3Sus = GetDlgItem(IDC_MOD2_SUSTAIN);
	gen3Rel = GetDlgItem(IDC_MOD2_RELEASE);
	gen3End = GetDlgItem(IDC_MOD2_END);
	gen3MulEd = GetDlgItem(IDC_M2M_EDIT);
	gen3NdxEd = GetDlgItem(IDC_M2I_EDIT);
	gen3AtkEd = GetDlgItem(IDC_M2A_EDIT);
	gen3PckEd = GetDlgItem(IDC_M2P_EDIT);
	gen3DecEd = GetDlgItem(IDC_M2D_EDIT);
	gen3SusEd = GetDlgItem(IDC_M2S_EDIT);
	gen3RelEd = GetDlgItem(IDC_M2R_EDIT);
	gen3EndEd = GetDlgItem(IDC_M2E_EDIT);

	InitValue(gen3Mul, gen3MulEd, 0,  100,  10);
	InitValue(gen3Ndx, gen3NdxEd, 0,  500,  50);
	InitValue(gen3Pck, gen3PckEd, 0,  500,  50);
	InitValue(gen3Sus, gen3SusEd, 0,  500,  50);
	InitValue(gen3End, gen3EndEd, 0,  500,  50);
	InitValue(gen3Atk, gen3AtkEd, 0, 4000, 400);
	InitValue(gen3Dec, gen3DecEd, 0, 4000, 400);
	InitValue(gen3Rel, gen3RelEd, 0, 4000, 400);

	durValEd = GetDlgItem(IDC_DUR_EDIT);
	durValEd.SetWindowText("4.0");
	volValEd = GetDlgItem(IDC_VOL);
	volValEd.SetWindowText("0.707");

	btnPlay = GetDlgItem(IDC_PLAY);
	btnLoop = GetDlgItem(IDC_LOOP);
	btnStop = GetDlgItem(IDC_STOP);
	RECT btnrc;
	btnPlay.GetClientRect(&btnrc);
	int cxy;
	if ((btnrc.bottom - btnrc.top) < 30)
		cxy = 16;
	else
		cxy = 32;
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_PLAY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnPlay.SetIcon(hIcon);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_LOOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnLoop.SetIcon(hIcon);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStop.SetIcon(hIcon);
	btnStop.EnableWindow(FALSE);

	CButton btnStyle;
	HBITMAP bm;

	btnStyle = GetDlgItem(IDC_STACK);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_STACK), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);
	btnStyle.SetCheck(BST_CHECKED);
	btnStyle = GetDlgItem(IDC_STACK2);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_STACK2), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);
	btnStyle = GetDlgItem(IDC_WYE);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_WYE), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);
	btnStyle = GetDlgItem(IDC_DELTA);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_DELTA), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);

	btnStyle = GetDlgItem(IDC_COPY_CLIP);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_COPY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SAVE);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_WVFILE), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_HELP2);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_HELP2), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);

	SetPreset(&resetParams);

	return TRUE;
}
Ejemplo n.º 23
0
LRESULT CLoginDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	
	DoDataExchange();

	::ZeroMemory(&m_RegInfo, sizeof(m_RegInfo));
	
	// TODO: Add your message handler code here and/or call default
	HICON hIcon= ::LoadIcon(_Module.GetModuleInstance(), MAKEINTRESOURCE(IDR_MAINFRAME));
	SetIcon(hIcon, FALSE);
	DeleteObject(hIcon);
	
	SetTimer(1,100,NULL);

	CenterWindow();
	m_cfg.m_FileName = System::GetProcessPathName() +  L"\\PSDemo.ini";

	CString ISIP = m_cfg.Get(L"Config", L"ISIP",L"Auto");
	CString UserName = m_cfg.Get(L"Config", L"UserName", L"ps_test");
	CString Password = m_cfg.Get(L"Config", L"Password", L"123123");
	int   AppID		= m_cfg.Get(L"Config", L"AppID",1)
		, SubID		= m_cfg.Get(L"Config", L"SubID",1)
		, MajorVer	= m_cfg.Get(L"Config", L"MajorVer",1)
		, SubVer	= m_cfg.Get(L"Config", L"SubVer",1);
	
	CComboBox box = GetDlgItem(IDC_COMBO1);
	struct ISServer{ wchar_t * server; } Servers[] = {
		L"tcp://60.28.222.89:7788",
		L"tcp://60.28.222.89:7789",
		L"tcp://127.0.0.1:7788",
		L"auto",
		L"tcp://192.168.1.252:7788",
		L"tcp://192.168.1.13:7788",
		NULL,
	};
	for(u_int a=0; a<sizeof(Servers)/sizeof(ISServer); a++)
	{
		box.InsertString(0,Servers[a].server);
	}
	box.SetWindowText(ISIP);

	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);


	box = GetDlgItem(IDC_APPID);
	for(int a=0; a<10; a++)
	{
		CString s;
		s.Format(L"%d", a);
		int nItem = box.InsertString(a, s);
		box.SetItemData(nItem, a);
	}
	box.SetCurSel(AppID);
	box = GetDlgItem(IDC_SUBID);
	for(int a=0; a<10; a++)
	{
		CString s;
		s.Format(L"%d", a);
		int nItem = box.InsertString(a, s);
		box.SetItemData(nItem, a);
	}
	box.SetCurSel(SubID);
	
	GetFramework()->SetUIClient(this);
	
	SetDlgItemText(IDC_USERNAME, UserName);
	SetDlgItemText(IDC_PASSWORD, Password);



	CString s;
	s.Format(L"PS - %s %s", _T(__DATE__), _T(__TIME__) );
	SetWindowText(s);

	m_mbtn.SubclassWindow(GetDlgItem(IDC_Game));
	m_mbtn.SpecailMenu(IDR_LOGINOPT);

	UIAddChildWindowContainer(m_hWnd);
//	logwin.Create(NULL,CWindow::rcDefault, L"LogWin");
	return TRUE;
}
Ejemplo n.º 24
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	camera_image_ = GetDlgItem(IDC_CAMERA_IMAGE);
	
	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	// Worker thread management
	task_runner_ = new TaskRunner();
	callback_handler_ = new CallbackHandler(camera_, task_runner_, m_hWnd);
	task_runner_->InsertTask(new OpenSessionTask(camera_, callback_handler_));

	// Property handling
	// Remember to handle the property change / desc change in the HandleObjectEvent when adding one here
	// ISO Speed
	property_handlers_[kEdsPropID_ISOSpeed] = new MultiValuePropertyHandler((CComboBox)GetDlgItem(IDC_ISO_COMBO), new IsoSpeedMapping());
	combobox_to_camera_property_[IDC_ISO_COMBO] = kEdsPropID_ISOSpeed;
	task_runner_->InsertTask(new PropertyPossibleValuesRetrieverTask(camera_, kEdsPropID_ISOSpeed, m_hWnd));
	// Aperture
	property_handlers_[kEdsPropID_Av] = new MultiValuePropertyHandler((CComboBox)GetDlgItem(IDC_APERTURE_COMBO), new ApertureMapping());
	combobox_to_camera_property_[IDC_APERTURE_COMBO] = kEdsPropID_Av;
	task_runner_->InsertTask(new PropertyPossibleValuesRetrieverTask(camera_, kEdsPropID_Av, m_hWnd));
	// Speed
	property_handlers_[kEdsPropID_Tv] = new MultiValuePropertyHandler((CComboBox)GetDlgItem(IDC_SPEED_COMBO), new SpeedMapping());
	combobox_to_camera_property_[IDC_SPEED_COMBO] = kEdsPropID_Tv;
	task_runner_->InsertTask(new PropertyPossibleValuesRetrieverTask(camera_, kEdsPropID_Tv, m_hWnd));
	// Title
	property_handlers_[kEdsPropID_ProductName] = new TitleHandler(this);
	task_runner_->InsertTask(new PropertyRetrieverTask<char*>(camera_, kEdsPropID_ProductName, m_hWnd));

	UIAddChildWindowContainer(m_hWnd);

	// Let's create a HBITMAP to store a preview of the picture
	BITMAPINFOHEADER headerInfo;
	headerInfo.biSize = sizeof(BITMAPINFOHEADER);
	headerInfo.biWidth = CMainDlg::kPreviewWidth;
	headerInfo.biHeight = -1 * CMainDlg::kPreviewHeight;
	headerInfo.biPlanes = 1;
	headerInfo.biBitCount = 24;
	headerInfo.biCompression = BI_RGB;
	headerInfo.biSizeImage = 0;
	headerInfo.biClrUsed = 0;
	headerInfo.biClrImportant = 0;
	headerInfo.biXPelsPerMeter = 0;
	headerInfo.biYPelsPerMeter = 0;

	BITMAPINFO bitmapInfo;
	bitmapInfo.bmiHeader = headerInfo;
	RGBQUAD quad = { 0, 0, 0, 0 };
	bitmapInfo.bmiColors[0] = quad;
	preview_bitmap_ = CreateDIBSection(NULL, (const BITMAPINFO*)&bitmapInfo, DIB_RGB_COLORS, (void**) &preview_bytes_, NULL, 0);
	camera_image_.SetBitmap(preview_bitmap_);

	// Create the TimeLapser
	time_lapser_ = new TimeLapser(task_runner_, camera_,  m_hWnd);

	// Browse dialog
	open_folder_dialog_ = new CFolderDialog(m_hWnd, _T("Pick the destination folder"));

	// Limiting timeout to kMaxTimeoutDigits digits
	CEdit timeoutEdit = (CEdit)GetDlgItem(IDC_TIMEOUT_EDIT);
	timeoutEdit.SetLimitText(kMaxTimeoutDigits);
	return TRUE;
}
Ejemplo n.º 25
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();
	
  // Set window icon
  SetIcon(::LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME)), 0);

  // Load heading icon
  HMODULE hExeModule = LoadLibrary(m_sImageName);
  if(hExeModule)
  {
    // Use IDR_MAINFRAME icon which is the default one for the crashed application.
    m_HeadingIcon = ::LoadIcon(hExeModule, MAKEINTRESOURCE(IDR_MAINFRAME));
  }  

  // If there is no IDR_MAINFRAME icon in crashed EXE module, use IDI_APPLICATION system icon
  if(m_HeadingIcon == NULL)
  {
    m_HeadingIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION));
  }  
 
  m_link.SubclassWindow(GetDlgItem(IDC_LINK));   
  m_link.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);

  m_linkMoreInfo.SubclassWindow(GetDlgItem(IDC_MOREINFO));
  m_linkMoreInfo.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);

  m_statEmail = GetDlgItem(IDC_STATMAIL);
  m_editEmail = GetDlgItem(IDC_EMAIL);
  m_statDesc = GetDlgItem(IDC_DESCRIBE);
  m_editDesc = GetDlgItem(IDC_DESCRIPTION);
  m_statCrashRpt = GetDlgItem(IDC_CRASHRPT);
  m_statHorzLine = GetDlgItem(IDC_HORZLINE);
  m_btnOk = GetDlgItem(IDOK);
  m_btnCancel = GetDlgItem(IDCANCEL);

  CRect rc1, rc2;
  m_linkMoreInfo.GetWindowRect(&rc1);
  m_statHorzLine.GetWindowRect(&rc2);
  m_nDeltaY = rc1.bottom+15-rc2.top;

  LOGFONT lf;
  memset(&lf, 0, sizeof(LOGFONT));
  lf.lfHeight = 25;
  lf.lfWeight = FW_NORMAL;
  lf.lfQuality = ANTIALIASED_QUALITY;
  _TCSCPY_S(lf.lfFaceName, 32, _T("Tahoma"));
  m_HeadingFont.CreateFontIndirect(&lf);

  ShowMoreInfo(FALSE);

  m_dlgProgress.Create(m_hWnd);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	return TRUE;
}
Ejemplo n.º 26
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

  int nItem = 0;

  m_cboThread = GetDlgItem(IDC_THREAD);

  nItem = m_cboThread.AddString(_T("Main thread"));
  m_cboThread.SetItemData(nItem, 0);
  
  nItem = m_cboThread.AddString(_T("Worker thread"));
  m_cboThread.SetItemData(nItem, 1);

  m_cboThread.SetCurSel(0);

  m_cboExcType = GetDlgItem(IDC_EXCTYPE);
  
  nItem = m_cboExcType.AddString(_T("SEH exception"));
  m_cboExcType.SetItemData(nItem, CR_SEH_EXCEPTION);

  nItem = m_cboExcType.AddString(_T("terminate"));
  m_cboExcType.SetItemData(nItem, CR_CPP_TERMINATE_CALL);

  nItem = m_cboExcType.AddString(_T("unexpected"));
  m_cboExcType.SetItemData(nItem, CR_CPP_UNEXPECTED_CALL);

  nItem = m_cboExcType.AddString(_T("pure virtual method call"));
  m_cboExcType.SetItemData(nItem, CR_CPP_PURE_CALL);

  nItem = m_cboExcType.AddString(_T("new operator fault"));
  m_cboExcType.SetItemData(nItem, CR_CPP_NEW_OPERATOR_ERROR);

  nItem = m_cboExcType.AddString(_T("buffer overrun"));
  m_cboExcType.SetItemData(nItem, CR_CPP_SECURITY_ERROR);

  nItem = m_cboExcType.AddString(_T("invalid parameter"));
  m_cboExcType.SetItemData(nItem, CR_CPP_INVALID_PARAMETER);

  nItem = m_cboExcType.AddString(_T("SIGABRT"));
  m_cboExcType.SetItemData(nItem, CR_CPP_SIGABRT);

  nItem = m_cboExcType.AddString(_T("SIGFPE"));
  m_cboExcType.SetItemData(nItem, CR_CPP_SIGFPE);

  nItem = m_cboExcType.AddString(_T("SIGILL"));
  m_cboExcType.SetItemData(nItem, CR_CPP_SIGILL);

  nItem = m_cboExcType.AddString(_T("SIGINT"));
  m_cboExcType.SetItemData(nItem, CR_CPP_SIGINT);

  nItem = m_cboExcType.AddString(_T("SIGSEGV"));
  m_cboExcType.SetItemData(nItem, CR_CPP_SIGSEGV);

  nItem = m_cboExcType.AddString(_T("SIGTERM"));
  m_cboExcType.SetItemData(nItem, CR_CPP_SIGTERM);

  nItem = m_cboExcType.AddString(_T("throw C++ typed exception"));
  m_cboExcType.SetItemData(nItem, CR_THROW);

  nItem = m_cboExcType.AddString(_T("Manual report"));
  m_cboExcType.SetItemData(nItem, MANUAL_REPORT);

  m_cboExcType.SetCurSel(0);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

  if(m_bRestarted)
  {
    PostMessage(WM_POSTCREATE);    
  }

	return TRUE;
}
Ejemplo n.º 27
0
LRESULT CErrorReportDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{   	
	CErrorReportSender* pSender = CErrorReportSender::GetInstance();
	CCrashInfoReader* pCrashInfo = pSender->GetCrashInfo();

    // Mirror this window if RTL language is in use.
    CString sRTL = pSender->GetLangStr(_T("Settings"), _T("RTLReading"));
    if(sRTL.CompareNoCase(_T("1"))==0)
    {
        Utility::SetLayoutRTL(m_hWnd);
    }

	// Set dialog caption.
    SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("DlgCaption")));

    // Center the dialog on the screen.
    CenterWindow();

    HICON hIcon = NULL;

    // Get custom icon.
    hIcon = pCrashInfo->GetCustomIcon();
    if(hIcon==NULL)
    {
        // Use default icon, if custom icon is not provided.
        hIcon = ::LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME));
    }

    // Set window icon.
    SetIcon(hIcon, 0);

    // Get the first icon in the EXE image and use it for header.
    m_HeadingIcon = ExtractIcon(NULL, pCrashInfo->GetReport(0)->GetImageName(), 0);

    // If there is no icon in crashed EXE module, use default IDI_APPLICATION system icon.
    if(m_HeadingIcon == NULL)
    {
        m_HeadingIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION));
    }  

	// Init controls.

    m_statSubHeader = GetDlgItem(IDC_SUBHEADER);

    m_link.SubclassWindow(GetDlgItem(IDC_LINK));   
    m_link.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);
	m_link.SetLabel(pSender->GetLangStr(_T("MainDlg"), _T("WhatDoesReportContain")));

    m_linkMoreInfo.SubclassWindow(GetDlgItem(IDC_MOREINFO));
    m_linkMoreInfo.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);
	m_linkMoreInfo.SetLabel(pSender->GetLangStr(_T("MainDlg"), _T("ProvideAdditionalInfo")));

    m_statEmail = GetDlgItem(IDC_STATMAIL);
    m_statEmail.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("YourEmail")));

    m_editEmail = GetDlgItem(IDC_EMAIL);
	m_editEmail.SetWindowText(pSender->GetCrashInfo()->GetPersistentUserEmail());

    m_statDesc = GetDlgItem(IDC_DESCRIBE);
    m_statDesc.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("DescribeProblem")));

    m_editDesc = GetDlgItem(IDC_DESCRIPTION);

    m_statIndent =  GetDlgItem(IDC_INDENT);

    m_chkRestart = GetDlgItem(IDC_RESTART);
    CString sCaption;
    sCaption.Format(pSender->GetLangStr(_T("MainDlg"), _T("RestartApp")), pSender->GetCrashInfo()->m_sAppName);
    m_chkRestart.SetWindowText(sCaption);
    m_chkRestart.SetCheck(BST_CHECKED);
    m_chkRestart.ShowWindow(pSender->GetCrashInfo()->m_bAppRestart?SW_SHOW:SW_HIDE);

    m_statConsent = GetDlgItem(IDC_CONSENT);

    // Init font for consent string.
    LOGFONT lf;
    memset(&lf, 0, sizeof(LOGFONT));
    lf.lfHeight = 11;
    lf.lfWeight = FW_NORMAL;
    lf.lfQuality = ANTIALIASED_QUALITY;
    _TCSCPY_S(lf.lfFaceName, 32, _T("Tahoma"));
    CFontHandle hConsentFont;
    hConsentFont.CreateFontIndirect(&lf);
    m_statConsent.SetFont(hConsentFont);

	// Set text of the static
    if(pSender->GetCrashInfo()->m_sPrivacyPolicyURL.IsEmpty())
        m_statConsent.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("MyConsent2")));
    else
        m_statConsent.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("MyConsent")));

	// Init Privacy Policy link
    m_linkPrivacyPolicy.SubclassWindow(GetDlgItem(IDC_PRIVACYPOLICY));
    m_linkPrivacyPolicy.SetHyperLink(pSender->GetCrashInfo()->m_sPrivacyPolicyURL);
    m_linkPrivacyPolicy.SetLabel(pSender->GetLangStr(_T("MainDlg"), _T("PrivacyPolicy")));

    BOOL bShowPrivacyPolicy = !pSender->GetCrashInfo()->m_sPrivacyPolicyURL.IsEmpty();  
    m_linkPrivacyPolicy.ShowWindow(bShowPrivacyPolicy?SW_SHOW:SW_HIDE);

    m_statCrashRpt = GetDlgItem(IDC_CRASHRPT);
    m_statHorzLine = GetDlgItem(IDC_HORZLINE);  

	// Init OK button
    m_btnOk = GetDlgItem(IDOK);
    m_btnOk.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("SendReport")));

	// Init Cancel button
    m_btnCancel = GetDlgItem(IDC_CANCEL);  
    if(pSender->GetCrashInfo()->m_bQueueEnabled)
        m_btnCancel.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("OtherActions")));
    else
        m_btnCancel.SetWindowText(pSender->GetLangStr(_T("MainDlg"), _T("CloseTheProgram")));

	// If send procedure is mandatory...
	if(pSender->GetCrashInfo()->m_bSendMandatory) 
	{
		// Hide Cancel button
		m_btnCancel.ShowWindow(SW_HIDE);
		// Remove Close button
		SetWindowLong(GWL_STYLE, GetWindowLong(GWL_STYLE) & ~WS_SYSMENU);
	}

    // Init font for heading text
    memset(&lf, 0, sizeof(LOGFONT));
    lf.lfHeight = 25;
    lf.lfWeight = FW_NORMAL;
    lf.lfQuality = ANTIALIASED_QUALITY;
    _TCSCPY_S(lf.lfFaceName, 32, _T("Tahoma"));
    m_HeadingFont.CreateFontIndirect(&lf);

	// Init control positions
    m_Layout.SetContainerWnd(m_hWnd);
    m_Layout.Insert(m_linkMoreInfo);
    m_Layout.Insert(m_statIndent);
    m_Layout.Insert(m_statEmail, TRUE);
    m_Layout.Insert(m_editEmail, TRUE);
    m_Layout.Insert(m_statDesc, TRUE);
    m_Layout.Insert(m_editDesc, TRUE);
    m_Layout.Insert(m_chkRestart);
    m_Layout.Insert(m_statConsent);
    m_Layout.Insert(m_linkPrivacyPolicy);  
    m_Layout.Insert(m_statCrashRpt);
    m_Layout.Insert(m_statHorzLine, TRUE);
    m_Layout.Insert(m_btnOk);
    m_Layout.Insert(m_btnCancel, TRUE);

	// By default, hide the email & description fields.
	// But user may override the default.
	ShowMoreInfo(pSender->GetCrashInfo()->m_bShowAdditionalInfoFields);

	// Create progress dialog
    m_dlgProgress.Create(m_hWnd);
    m_dlgProgress.Start(TRUE);

    // register object for message filtering and idle updates
    CMessageLoop* pLoop = _Module.GetMessageLoop();
    ATLASSERT(pLoop != NULL);
    if(pLoop)
    {
        pLoop->AddMessageFilter(this);        
    }

    UIAddChildWindowContainer(m_hWnd);

    return TRUE;
}
Ejemplo n.º 28
0
LRESULT CFlashPlayerDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	if(m_applang == 2)
		m_popmenu.LoadMenu(IDR_MENU_FLASH_EN);
	else if(m_applang == 3 || m_applang == 4)
		m_popmenu.LoadMenu(IDR_MENU_FLASH_TC);
	else
		m_popmenu.LoadMenu(IDR_MENU_FLASH);

	s_uTBBC = RegisterWindowMessage(L"TaskbarButtonCreated");
	HINSTANCE user32 = GetModuleHandle(L"user32.dll");
	if(user32) ChangeWindowMessageFilterDLL = (ChangeWindowMessageFilterFunction)GetProcAddress(user32, "ChangeWindowMessageFilter");
	if(ChangeWindowMessageFilterDLL) {
		ChangeWindowMessageFilterDLL(s_uTBBC, MSGFLT_ADD);
		ChangeWindowMessageFilterDLL(WM_COMMAND, MSGFLT_ADD);
	}

	m_wndFlashPlayer.Attach(GetDlgItem(IDC_SHOCKWAVEFLASH));
	m_control.Attach(GetDlgItem(IDC_SLIDER_CONTROL));

	m_wndFlashPlayer.QueryControl(&pFlashPtr);

	m_control.SetRange(0, 100);
	m_inited = true;


	if(m_ontop)
		::SetWindowPos(this->m_hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);
	SetTimer(0, 300, 0);

	DoDataExchange();

	LoadConfig();
	
	pFlashPtr->put_Loop(FALSE);
	if(m_playlist.GetSize() > 0) {
		m_current = 0;
		PlayFile();
		if(m_fs_init)
			FullScreen(true);
	}
	
	return TRUE;
}
Ejemplo n.º 29
0
LRESULT CErrorReportDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{   
    // Mirror this window if RTL language is in use
    CString sRTL = Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("Settings"), _T("RTLReading"));
    if(sRTL.CompareNoCase(_T("1"))==0)
    {
        Utility::SetLayoutRTL(m_hWnd);
    }

    SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("DlgCaption")));

    // Center the dialog on the screen
    CenterWindow();

    HICON hIcon = NULL;

    // Get custom icon
    hIcon = g_CrashInfo.GetCustomIcon();
    if(hIcon==NULL)
    {
        // Use default icon
        hIcon = ::LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME));
    }

    // Set window icon
    SetIcon(hIcon, 0);

    // Get the first icon in the EXE image
    m_HeadingIcon = ExtractIcon(NULL, g_CrashInfo.GetReport(0).m_sImageName, 0);

    // If there is no icon in crashed EXE module, use IDI_APPLICATION system icon
    if(m_HeadingIcon == NULL)
    {
        m_HeadingIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION));
    }  

    m_statSubHeader = GetDlgItem(IDC_SUBHEADER);

    m_link.SubclassWindow(GetDlgItem(IDC_LINK));   
    m_link.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);
    m_link.SetLabel(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("WhatDoesReportContain")));

    m_linkMoreInfo.SubclassWindow(GetDlgItem(IDC_MOREINFO));
    m_linkMoreInfo.SetHyperLinkExtendedStyle(HLINK_COMMANDBUTTON);
    m_linkMoreInfo.SetLabel(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("ProvideAdditionalInfo")));

    m_statEmail = GetDlgItem(IDC_STATMAIL);
    m_statEmail.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("YourEmail")));

    m_editEmail = GetDlgItem(IDC_EMAIL);

    m_statDesc = GetDlgItem(IDC_DESCRIBE);
    m_statDesc.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("DescribeProblem")));

    m_editDesc = GetDlgItem(IDC_DESCRIPTION);

    m_statIndent =  GetDlgItem(IDC_INDENT);

    m_chkRestart = GetDlgItem(IDC_RESTART);
    CString sCaption;
    sCaption.Format(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("RestartApp")), g_CrashInfo.m_sAppName);
    m_chkRestart.SetWindowText(sCaption);
    m_chkRestart.SetCheck(BST_CHECKED);
    m_chkRestart.ShowWindow(g_CrashInfo.m_bAppRestart?SW_SHOW:SW_HIDE);

    m_statConsent = GetDlgItem(IDC_CONSENT);

    // Init font for consent string
    LOGFONT lf;
    memset(&lf, 0, sizeof(LOGFONT));
    lf.lfHeight = 11;
    lf.lfWeight = FW_NORMAL;
    lf.lfQuality = ANTIALIASED_QUALITY;
    _TCSCPY_S(lf.lfFaceName, 32, _T("Tahoma"));
    CFontHandle hConsentFont;
    hConsentFont.CreateFontIndirect(&lf);
    m_statConsent.SetFont(hConsentFont);

    if(g_CrashInfo.m_sPrivacyPolicyURL.IsEmpty())
        m_statConsent.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("MyConsent2")));
    else
        m_statConsent.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("MyConsent")));

    m_linkPrivacyPolicy.SubclassWindow(GetDlgItem(IDC_PRIVACYPOLICY));
    m_linkPrivacyPolicy.SetHyperLink(g_CrashInfo.m_sPrivacyPolicyURL);
    m_linkPrivacyPolicy.SetLabel(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("PrivacyPolicy")));

    BOOL bShowPrivacyPolicy = !g_CrashInfo.m_sPrivacyPolicyURL.IsEmpty();  
    m_linkPrivacyPolicy.ShowWindow(bShowPrivacyPolicy?SW_SHOW:SW_HIDE);

    m_statCrashRpt = GetDlgItem(IDC_CRASHRPT);
    m_statHorzLine = GetDlgItem(IDC_HORZLINE);  

    m_btnOk = GetDlgItem(IDOK);
    m_btnOk.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("SendReport")));

    m_btnCancel = GetDlgItem(IDC_CANCEL);  
    if(g_CrashInfo.m_bQueueEnabled)
        m_btnCancel.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("OtherActions")));
    else
        m_btnCancel.SetWindowText(Utility::GetINIString(g_CrashInfo.m_sLangFileName, _T("MainDlg"), _T("CloseTheProgram")));

    // Init font for heading text
    memset(&lf, 0, sizeof(LOGFONT));
    lf.lfHeight = 25;
    lf.lfWeight = FW_NORMAL;
    lf.lfQuality = ANTIALIASED_QUALITY;
    _TCSCPY_S(lf.lfFaceName, 32, _T("Tahoma"));
    m_HeadingFont.CreateFontIndirect(&lf);

    m_Layout.SetContainerWnd(m_hWnd);
    m_Layout.Insert(m_linkMoreInfo);
    m_Layout.Insert(m_statIndent);
    m_Layout.Insert(m_statEmail, TRUE);
    m_Layout.Insert(m_editEmail, TRUE);
    m_Layout.Insert(m_statDesc, TRUE);
    m_Layout.Insert(m_editDesc, TRUE);
    m_Layout.Insert(m_chkRestart);
    m_Layout.Insert(m_statConsent);
    m_Layout.Insert(m_linkPrivacyPolicy);  
    m_Layout.Insert(m_statCrashRpt);
    m_Layout.Insert(m_statHorzLine, TRUE);
    m_Layout.Insert(m_btnOk);
    m_Layout.Insert(m_btnCancel, TRUE);

    ShowMoreInfo(FALSE);

    m_dlgProgress.Create(m_hWnd);
    m_dlgProgress.Start(TRUE);

    // register object for message filtering and idle updates
    CMessageLoop* pLoop = _Module.GetMessageLoop();
    ATLASSERT(pLoop != NULL);
    if(pLoop)
    {
        pLoop->AddMessageFilter(this);
        pLoop->AddIdleHandler(this);
    }

    UIAddChildWindowContainer(m_hWnd);

    return TRUE;
}
Ejemplo n.º 30
0
LRESULT CPlayerDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	UIAddChildWindowContainer(m_hWnd);
	int value_i;
	double value_d;
	CString value_s;

	SetDlgItemText(IDC_CHECK_FULLSCREEN, rStr.cfulls);
	SetDlgItemText(IDC_CHECK_RTSEEK, rStr.crseek);
	SetDlgItemText(IDC_CHECK_ONLYONE, rStr.conep);
	SetDlgItemText(IDC_CHECK_GUITHREAD, rStr.cguit);
	SetDlgItemText(IDC_CHECK_GUI, rStr.cguip);
	SetDlgItemText(IDC_CHECK_URL, rStr.curl);
	SetDlgItemText(IDC_CHECK_QUIT, rStr.cquit);
	SetDlgItemText(IDC_CHECK_QUIET, rStr.cquiet);
	SetDlgItemText(IDC_CHECK_DOUBLE, rStr.cdouble);
	SetDlgItemText(IDC_CHECK_CONF, rStr.cconf);
	SetDlgItemText(IDC_CHECK_HTIMER, rStr.chtime);
	SetDlgItemText(IDC_CHECK_DVDNAV, rStr.cdvd);
	SetDlgItemText(IDC_CHECK_RELOAD, rStr.creload);
	SetDlgItemText(IDC_CHECK_FRAMEDROP, rStr.cfdrop);
	SetDlgItemText(IDC_CHECK_REINDEX, rStr.cidx);

	SetDlgItemText(IDC_STATIC_DEF, rStr.copen);
	SetDlgItemText(IDC_STATIC_PNG, rStr.cpng);
	SetDlgItemText(IDC_BUTTON_PNG, rStr.browser);
	SetDlgItemText(IDC_BUTTON_DEF, rStr.browser);

	InitCheckBox();
	
	aComboPriority.InitCtrl(GetDlgItem(IDC_LISTCTRL_PRIORITY));
	aComboASync.InitCtrl(GetDlgItem(IDC_LISTCTRL_AUTOSYNC));
	aComboAPlay.InitCtrl(GetDlgItem(IDC_LISTCTRL_AUTOPLAY));
	aComboCache.InitCtrl(GetDlgItem(IDC_LISTCTRL_CACHE));
	aComboMonitor.InitCtrl(GetDlgItem(IDC_LISTCTRL_MONITOR), TRUE);
	aComboLoop.InitCtrl(GetDlgItem(IDC_LISTCTRL_LOOP));
	aComboLog.InitCtrl(GetDlgItem(IDC_LISTCTRL_LOG));

	//Skip Time
	RECT rc;
	int width = 68, widtht;
	ListTime.RegisterClass();
	ListTime.ShowBorder(FALSE);
	ListTime.Show3DColor();
	ListTime.SubclassWindow( GetDlgItem(IDC_LISTCTRL_TIME) );
	ListTime.ShowHeader(FALSE);
	ListTime.ShowSelected(FALSE);
	ListTime.GetClientRect(&rc);
	widtht = (rc.right - rc.left)/2 - width-1;
	ListTime.AddColumn(_T(""), width, ITEM_IMAGE_NONE, FALSE, ITEM_FORMAT_NONE);
	ListTime.AddColumn(_T(""), widtht, ITEM_IMAGE_NONE, FALSE, ITEM_FORMAT_DATETIME, ITEM_FLAGS_TIME_ONLY);
	ListTime.AddColumn(_T(""), width, ITEM_IMAGE_NONE, FALSE, ITEM_FORMAT_NONE);
	ListTime.AddColumn(_T(""), widtht, ITEM_IMAGE_NONE, FALSE, ITEM_FORMAT_DATETIME, ITEM_FLAGS_TIME_ONLY);
	ListTime.AddItem(rStr.cstart);
	ListTime.SetItemText(0, 2, rStr.cend);
	ListTime.SelectItem(0, 0);
	value_i = 0;
	if(mconfig.GetString(_T("ss"), value_s)) {
		if(value_s.Find(_T(":")) > 0) {
			int a1, a2, a3;
			int len = _stscanf_s(value_s.GetBuffer(), _T("%d:%d:%d"), &a1, &a2, &a3);
			if(len == 1)
				value_i = a1;
			else if(len == 2)
				value_i = a1 *60 + a2;
			else if(len == 3)
				value_i = a1 * 3600 + a2 *60 + a3;
		} else
			value_i = _ttoi(value_s);
	}
	ListTime.SetItemText(0, 1, ListTimetoString(value_i));
	ListTime.SetItemText(0, 3, ListTimetoString(mconfig.GetInteger(_T("end_pos"), 0, true)));

	//Priority
	aComboPriority.SetTitle(rStr.piority);
	aComboPriority.AddString(rStr.autos);
	aComboPriority.AddString(rStr.piority1);
	aComboPriority.AddString(rStr.piority2);
	aComboPriority.AddString(rStr.piority3);
	aComboPriority.AddString(rStr.piority4);
	aComboPriority.AddString(rStr.piority5);
	aComboPriority.AddString(rStr.piority6);

	if(mconfig.GetString(_T("priority"), value_s)) {
		if(value_s == _T("realtime"))
			aComboPriority.SelecteIndex(prio_realtime);
		else if(value_s == _T("high"))
			aComboPriority.SelecteIndex(prio_high);
		else if(value_s == _T("abovenormal"))
			aComboPriority.SelecteIndex(prio_abovenormal);
		else if(value_s == _T("normal"))
			aComboPriority.SelecteIndex(prio_normal);
		else if(value_s == _T("belownormal"))
			aComboPriority.SelecteIndex(prio_belownormal);
		else if(value_s == _T("idle"))
			aComboPriority.SelecteIndex(prio_idle);
		else
			aComboPriority.SelecteIndex(prio_auto);
	} else
		aComboPriority.SelecteIndex(prio_auto);

	//AutoSync
	aComboASync.SetTitle(rStr.async);
	aComboASync.AddString(rStr.async0);
	aComboASync.AddString(rStr.async1);
	aComboASync.AddString(rStr.async2);
	aComboASync.AddString(rStr.async3);
	aComboASync.AddString(rStr.async4);
	aComboASync.AddString(rStr.async5);

	int sync = mconfig.GetInteger(_T("autosync"), -1);
	if(sync == 0) {
		value_d = mconfig.GetDouble(_T("mc"), -1);
		if(value_d > 0) {
			if(value_d <= 0.01)
				aComboASync.SelecteIndex(sync_flvex);
			else
				aComboASync.SelecteIndex(sync_flv);
		} else if(mconfig.GetBoolean(_T("nobps")))
			aComboASync.SelecteIndex(sync_avi);
		else
			aComboASync.SelecteIndex(sync_none);
	} else if(sync > 0 && sync <= 30 )
		aComboASync.SelecteIndex(sync_normal);
	else if(sync > 30 )
		aComboASync.SelecteIndex(sync_fast);
	else
		aComboASync.SelecteIndex(sync_none);

	//AutoPlay
	aComboAPlay.SetTitle(rStr.aplay);
	aComboAPlay.AddString(rStr.playna);
	aComboAPlay.AddString(rStr.autos);
	aComboAPlay.AddString(rStr.playex + _T(" (n = 6)"));
	aComboAPlay.AddString(rStr.playex + _T(" (n = 10)"));
	aComboAPlay.AddString(rStr.playex + _T(" (n = 20)"));
	aComboAPlay.AddString(rStr.playex + _T(" (n = 50)"));
	aComboAPlay.AddString(rStr.playex + _T(" (n = 100)"));
	aComboAPlay.AddString(rStr.playex + _T(" (n = 200)"));

	if(mconfig.GetBoolean(_T("autoplay"))) {
		value_i = mconfig.GetInteger(_T("autoplay_fuzziness"), 0, true);
		if(value_i > 0) {
			if(value_i >= 200)
				aComboAPlay.SelecteIndex(play_ex_200);
			else if(value_i >= 100)
				aComboAPlay.SelecteIndex(play_ex_100);
			else if(value_i >= 50)
				aComboAPlay.SelecteIndex(play_ex_50);
			else if(value_i >= 20)
				aComboAPlay.SelecteIndex(play_ex_20);
			else if(value_i >= 10)
				aComboAPlay.SelecteIndex(play_ex_10);
			else
				aComboAPlay.SelecteIndex(play_ex_6);
		} else
			aComboAPlay.SelecteIndex(play_auto);
	} else
		aComboAPlay.SelecteIndex(play_none);

	//Cache
	aComboCache.SetTitle(rStr.cache);
	aComboCache.AddString(rStr.nos);
	aComboCache.AddString(_T("512 KB"));
	aComboCache.AddString(_T("1 M"));
	aComboCache.AddString(_T("2 M"));
	aComboCache.AddString(_T("4 M"));
	aComboCache.AddString(_T("8 M"));
	aComboCache.AddString(_T("16 M"));
	aComboCache.AddString(_T("32 M"));
	aComboCache.AddString(_T("64 M"));
	aComboCache.AddString(_T("96 M"));
	aComboCache.AddString(_T("128 M"));
	aComboCache.AddString(_T("256 M"));
	aComboCache.AddString(rStr.autos);
	
	mconfig.GetInteger(_T("cache-min"));
	if(mconfig.GetBoolean(_T("auto-cache")))
		aComboCache.SelecteIndex(cache_auto);
	else {
		value_i = mconfig.GetInteger(_T("cache"), -1);
		if(value_i <= 0)
			aComboCache.SelecteIndex(cache_none);
		else if(value_i <= 512)
			aComboCache.SelecteIndex(cache_512K);
		else if(value_i <= 1024)
			aComboCache.SelecteIndex(cache_1);
		else if(value_i <= 2048)
			aComboCache.SelecteIndex(cache_2);
		else if(value_i <= 4096)
			aComboCache.SelecteIndex(cache_4);
		else if(value_i <= 8192)
			aComboCache.SelecteIndex(cache_8);
		else if(value_i <=16384)
			aComboCache.SelecteIndex(cache_16);
		else if(value_i <=32768)
			aComboCache.SelecteIndex(cache_32);
		else if(value_i <=65536)
			aComboCache.SelecteIndex(cache_64);
		else if(value_i <=98304)
			aComboCache.SelecteIndex(cache_96);
		else if(value_i <=131072)
			aComboCache.SelecteIndex(cache_128);
		else
			aComboCache.SelecteIndex(cache_256);
	}


	//Monitor
	aComboMonitor.SetTitle(rStr.monitor);
	aComboMonitor.AddString(rStr.autos);
	aComboMonitor.AddString(_T("4:3"));
	aComboMonitor.AddString(_T("8:5"));
	aComboMonitor.AddString(_T("16:9"));

	if(mconfig.GetString(_T("monitoraspect"),value_s)){
		if(aComboMonitor.FindStringExactNoCase(0, value_s) < 0)
			aComboMonitor.AddString(value_s);
		aComboMonitor.SelecteText(value_s);
	} else 
		aComboMonitor.SelecteIndex(0);

	//Loop
	aComboLoop.SetTitle(rStr.loops);
	aComboLoop.AddString(rStr.playna);
	aComboLoop.AddString(rStr.loopf);
	aComboLoop.AddString(rStr.loopl);

	if(mconfig.GetInteger(_T("loop"), -1) >= 0) {
		if(mconfig.GetBoolean(_T("loop_all"), false, true))
			aComboLoop.SelecteIndex(loop_list);
		else
			aComboLoop.SelecteIndex(loop_single);
	} else
		aComboLoop.SelecteIndex(loop_none);

	//Log
	aComboLog.SetTitle(rStr.log);
	aComboLog.AddString(rStr.logn);
	aComboLog.AddString(rStr.log0);
	aComboLog.AddString(rStr.log1);
	aComboLog.AddString(rStr.log2);
	aComboLog.AddString(rStr.log3);
	aComboLog.AddString(rStr.log4);
	aComboLog.AddString(rStr.log5);
	aComboLog.AddString(rStr.logc);
	aComboLog.AddString(rStr.logc +_T("(v=1)"));
	aComboLog.AddString(rStr.logc +_T("(v=2)"));
	aComboLog.AddString(rStr.logc +_T("(v=3)"));
	aComboLog.AddString(rStr.logc +_T("(v=4)"));
	aComboLog.AddString(rStr.logc +_T("(v=5)"));

	value_i = mconfig.GetInteger(_T("log"), 0, true);
	if(value_i) {
		if(value_i == 2) {
			value_i = mconfig.GetInteger(_T("v"), 0);
			value_i += log_console;
			if(value_i < log_console || value_i > log_console_v5)
				value_i = log_console;
			aComboLog.SelecteIndex(value_i);
		} else {
			value_i = mconfig.GetInteger(_T("v"), 0);
			value_i += log_normal;
			if(value_i < log_normal || value_i > log_v5)
				value_i = log_normal;
			aComboLog.SelecteIndex(value_i);
		}
	} else
		aComboLog.SelecteIndex(log_none);
	

	DoDataExchange();
	
	return TRUE;
}