BOOL OptionsDialog::OnInitDialog() 
{
  CPropertySheet::OnInitDialog();

  // Enable context sensitive help
  ModifyStyleEx(0,WS_EX_CONTEXTHELP);

  // Create the font to use
  m_font.CreateFontIndirect(&m_logFont);

  // Set the font for the property pages
  ChangeDialogFont(this,&m_font);
  CPropertyPage* page = GetActivePage();
  for (int i = 0; i < GetPageCount(); i++)
  {
    SetActivePage(i);
    CPropertyPage* page = GetActivePage();
    ChangeDialogFont(page,&m_font);
  }
  SetActivePage(page);

  // Resize the property page
  CTabCtrl* tab = GetTabControl();
  tab->GetWindowRect(&m_page);
  ScreenToClient(&m_page);
  tab->AdjustRect(FALSE,&m_page);
  page->MoveWindow(&m_page);

  return TRUE;
}
LRESULT CCustomPropSheet::OnResizePage(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
	CPropertyPage* pCurPage = GetActivePage();
	ASSERT(pCurPage != NULL);
	pCurPage->MoveWindow(&m_rcPage);
	return (0);
}
//*********************************************************************************
BOOL CBCGPropSheetTab::SetActiveTab (int iTab)
{
	ASSERT_VALID (this);
	ASSERT_VALID (m_pParent);

	CWaitCursor wait;

	if (m_pParent->GetActiveIndex () != iTab)
	{
		m_pParent->SetActivePage (iTab);
	}

	CBCGTabWnd::SetActiveTab (iTab);

	CRect rectWndArea = m_rectWndArea;
	MapWindowPoints (m_pParent, rectWndArea);

	CPropertyPage* pPage = m_pParent->GetPage (iTab);
	if (pPage != NULL)
	{
		pPage->SetWindowPos (NULL, rectWndArea.left, rectWndArea.top,
			rectWndArea.Width (), rectWndArea.Height (),
			SWP_NOACTIVATE | SWP_NOZORDER);
	}

	return TRUE;
}
BOOL CAlertDlg::OnInitDialog()
{
    BOOL Result = CDialogEx::OnInitDialog();

    CPropertyPage* pPage = (CPropertyPage*)m_pParent;
    PROPSHEETPAGE PageInfo = pPage->GetPSP();

    if(_tcsicmp(PageInfo.pszTitle, _T("Keyboards")) == 0)
    {
        m_DeviceType = 1;
    }
    else if(_tcsicmp(PageInfo.pszTitle, _T("Mousemats")) == 0)
    {
        m_DeviceType = 2;
    }
    else if(_tcsicmp(PageInfo.pszTitle, _T("Mice")) == 0)
    {
        m_DeviceType = 3;
    }
    else if(_tcsicmp(PageInfo.pszTitle, _T("Headsets")) == 0)
    {
        m_DeviceType = 4;
    }
    else if(_tcsicmp(PageInfo.pszTitle, _T("Keypads")) == 0)
    {
        m_DeviceType = 5;
    }
    else if(_tcsicmp(PageInfo.pszTitle, _T("Chroma Linked Devices")) == 0)
    {
        m_DeviceType = 6;
    }

    return Result;
}
Exemple #5
0
void CPreferencesDlg::OnHelp()
{
	int iCurSel = GetActiveIndex();
	//Xman no crash on F1 (remark: 12 pages are official)
	/*
	if (iCurSel >= 0)
	*/
	if (iCurSel >= 0 && iCurSel<=12)
	//Xman end
	{
		CPropertyPage* pPage = GetPage(iCurSel);
		if (pPage)
		{
			HELPINFO hi = {0};
			hi.cbSize = sizeof hi;
			hi.iContextType = HELPINFO_WINDOW;
			hi.iCtrlId = 0;
			hi.hItemHandle = pPage->m_hWnd;
			hi.dwContextId = 0;
			pPage->SendMessage(WM_HELP, 0, (LPARAM)&hi);
			return;
		}
	}

	theApp.ShowHelp(0, HELP_CONTENTS);
}
/*
	OnSelchangedTree()
*/
void CWallPaperDrawSettingsDlg::OnSelchangedTree(NMHDR* /*pNMHDR*/,LRESULT* pResult)
{
	if(m_bCreated)
	{
		HTREEITEM hCurrent = m_wndSettingsTree.GetSelectedItem();
		if(hCurrent)
		{
			CPropertyPage* pPropertyPage = (CPropertyPage*)m_wndSettingsTree.GetItemData(hCurrent);
			if(pPropertyPage)
			{
				m_ctrlSettingsArea.SetText("");	
				m_ctrlSettingsArea.ShowWindow(SW_HIDE);

				pPropertyPage->ShowWindow(SW_SHOW);
				pPropertyPage->OnSetActive();
			}
			else
			{
				m_ctrlSettingsArea.SetText(IDS_DIALOG_DRAW_SETTINGS_TITLE);	
				m_ctrlSettingsArea.ShowWindow(SW_SHOW);
			}
		}
	}

	*pResult = 0;
}
BOOL CQuestionnaireSettings::ContinueModal() {
    CPropertyPage* pActivePage = GetActivePage();
    if (NULL != pActivePage)
        pActivePage->SendMessage(WM_KICKIDLE, 0, 0); 

    return CPropertySheet::ContinueModal();
}
BOOL CCustomPropSheet::OnInitDialog(void)
{
	__super::OnInitDialog();

	// get the font for the first active page
	CPropertyPage* pCurPage = GetActivePage();
	ASSERT(pCurPage != NULL);

	// change the font for the sheet
	ChangeDialogFont(this, &m_fontPage, CDF_CENTER);

	// change the font for each page
	for (int i = 0, cPages = GetPageCount(); i < cPages; ++i)
	{
		CPropertyPage* pPage = GetPage(i);
		ASSERT(pPage != NULL);
#if !defined(_BUGFIX_)
		ChangeDialogFont(pPage, &m_fontPage, CDF_CENTER);
#else
		ChangeDialogFont(pPage, &m_fontPage, CDF_TOPLEFT);
#endif   // _BUGFIX_
	}

	// set and save the size of the page
	CTabCtrl* pTab = GetTabControl();
	ASSERT(pTab != NULL);

	if ((m_psh.dwFlags & PSH_WIZARD) != 0)
	{
		pTab->ShowWindow(SW_HIDE);
#if !defined(_BUGFIX_)
		GetClientRect(&m_rcPage);
		CWnd* pButton = GetDlgItem(ID_WIZBACK);
		ASSERT(pButton != NULL);
		CRect rectButton;
		pButton->GetWindowRect(rectButton);
		ScreenToClient(rectButton);
		m_rcPage.bottom = rectButton.top - 2;
#else
		CRect rectDivider;
		CWnd* pDivider = GetDlgItem(0x3026);
		ASSERT(pDivider != NULL);
		pDivider->GetWindowRect(rectDivider);
		ScreenToClient(rectDivider);
		m_rcPage.bottom = rectDivider.top - 2;
#endif   // _BUGFIX_
	}
	else
	{
		pTab->GetWindowRect(&m_rcPage);
		ScreenToClient(&m_rcPage);
		pTab->AdjustRect(FALSE, &m_rcPage);
	}

	// resize the page
	pCurPage->MoveWindow(&m_rcPage);

	return (TRUE);
}
Exemple #9
0
void CCodJobListView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
	if (0 == lHint || UAVH_JOBS == lHint) {
		CPropertyPage *ActivePage = m_PropertySheet.GetActivePage();
		ASSERT_VALID(ActivePage);
		ActivePage->OnInitDialog();
	}
}
CPropertyPage* CPropertyPageHost::GetActivePage()
{
	if (m_nSelIndex < 0)
		return NULL;

	CPropertyPage* pPage = m_aPages[m_nSelIndex].pPage;

	if (!pPage || !pPage->GetSafeHwnd())
		return NULL;

	return pPage;
}
void CPropertyPageHost::OnApply()
{
	int nPage = m_aPages.GetSize();

	while (nPage--)
	{
		CPropertyPage* pPage = m_aPages[nPage].pPage;

		if (pPage && pPage->GetSafeHwnd())
			pPage->UpdateData();
	}
}
Exemple #12
0
void CxDlgPropertySheetSqlWizard::OnHelp()
{
	CTabCtrl* pTab = GetTabControl();
	ASSERT(pTab);
	if (pTab)
	{
		int nActivePage = pTab->GetCurSel();
		CPropertyPage* pPage = GetPage(nActivePage);
		if (pPage)
			pPage->SendMessage (WM_HELP);
	}
}
Exemple #13
0
LRESULT CMainFrame::OnAddOptionPageMessage(WPARAM wParam, LPARAM lParam)
{
	if (m_OptDialog != NULL)
	{
		CPropertyPage *tProp;

		tProp = (CPropertyPage *)lParam;
		VERIFY(tProp->IsKindOf(RUNTIME_CLASS(CPropertyPage)));

		m_OptDialog->AddPage(tProp);
	}

	return TRUE;
}
Exemple #14
0
void CConfigMsgDlg::OnChangeEDITMsgMaxSize() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	// TODO: Add your control notification handler code here
	
	CWnd *pParent = GetParent();
	CPropertyPage *pPropParent = (CPropertyPage *)pParent;

	if(pPropParent)
		pPropParent->SetModified(TRUE);
}
/*
	OnSelchangingTree()
*/
void CWallPaperDrawSettingsDlg::OnSelchangingTree(NMHDR* /*pNMHDR*/,LRESULT* pResult)
{
	if(m_bCreated)
	{
		HTREEITEM hCurrent = m_wndSettingsTree.GetSelectedItem();
		if(hCurrent)
		{
			CPropertyPage* pPropertyPage = (CPropertyPage*)m_wndSettingsTree.GetItemData(hCurrent);
			if(pPropertyPage)
				pPropertyPage->ShowWindow(SW_HIDE);
		}
	}

	*pResult = 0;
}
void CElementProperSheet::OnApply()
{
	//调用每个页面的应用函数
	if(m_pElement == NULL)
		return;

	CPropertyPage* pPage = GetActivePage();
	pPage->OnApply();

	//获取活动制图控件
	if(m_pCallBack)
	{
		m_pCallBack->UpdateMapCtrl();
	}
}
void CListViewWalkerPropertySheet::ChangeData(CObject* pObj)
{
	m_aItems.RemoveAll();
	m_aItems.Add(pObj);
	SendMessage(UM_DATA_CHANGED);

	for (int iPage = 0; iPage < GetPageCount(); iPage++)
	{
		CPropertyPage* pPage = GetPage(iPage);
		if (pPage && pPage->m_hWnd)
		{
			pPage->SendMessage(UM_DATA_CHANGED);
			pPage->SetModified(FALSE);
		}
	}
	GetActivePage()->OnSetActive();
}
void CBCGPPropertySheetCtrl::ResizeControl()
{
	CWnd* pTabCtrl = GetTabControl();
	if (m_wndTab.GetSafeHwnd() != NULL)
	{
		pTabCtrl = &m_wndTab;
		m_wndTab.SetButtonsVisible(FALSE);
	}

	if (pTabCtrl->GetSafeHwnd() == NULL)
	{
		return;
	}

	CRect rectClient;
	GetClientRect(rectClient);

	pTabCtrl->SetWindowPos(NULL, 
		0, 0, rectClient.Width(), rectClient.Height(), 
		SWP_NOZORDER | SWP_NOACTIVATE);

	int nPageCount = CBCGPPropertySheet::GetPageCount();

	int nXBorder = ::GetSystemMetrics(SM_CXEDGE);
	int nYBorder = ::GetSystemMetrics(SM_CYEDGE);
	
	for (int nPage = 0; nPage <= nPageCount - 1; nPage++)
	{
		CPropertyPage* pPage = GetPage(nPage);
		if (pPage->GetSafeHwnd() != NULL)
		{
			CRect rectPage;

			pPage->GetWindowRect(&rectPage);
			pTabCtrl->ScreenToClient(rectPage);

			pPage->SetWindowPos(NULL, 
				rectPage.left, rectPage.top, 
				rectClient.Width() - nXBorder * 3, 
				rectClient.Height() - rectPage.top - nYBorder,
				SWP_NOZORDER | SWP_NOACTIVATE);
		}
	}

	RedrawWindow();
}
LRESULT CExtChildResizablePropertySheet::OnLoadSettings(WPARAM wParam, LPARAM lParam)
{

	for(int i = 0; i < GetPageCount(); i++){

		CPropertyPage* page = GetPage(i);
		
		TRACE("Testing page %d\n", i);

		if(!page) continue;
		if(!::IsWindow(page->m_hWnd)) continue;
		
		TRACE("Page %d is ok\n", i);

		page->SendMessage(UWM_SETTINGS, wParam, lParam);
	}

	return 1;
}
void CCodComplexAtributeView::OnSend()
{
	ASSERT_VALID(m_SplitterFrame);

	CQmonntDoc *Doc = dynamic_cast<CQmonntDoc *>(GetDocument());
	ASSERT_VALID(Doc);

	AfxMessageBox("Hello");

	CPropertyPage *ActivePage = m_PropertySheet.GetActivePage();
	ASSERT_VALID(ActivePage);
	ActivePage->UpdateData(TRUE);

	// Änderungen an das Dokument übergeben, dort werden sie mit der Gesamtliste 
	// vereinigt.
	Doc->SetChangedData(&m_LocalComplexAtributeSet);

	m_SplitterFrame->SetModified(false);
	m_LocalComplexAtributeSet.ClearModified();
}
Exemple #21
0
BOOL CTutorialDlg::OnInitDialog()
{
    BOOL Result = CDialogEx::OnInitDialog();
    if(Result == TRUE)
    {
        CPropertyPage* pPage = (CPropertyPage*)m_pParent;
        PROPSHEETPAGE PageInfo = pPage->GetPSP();

        if(_tcsicmp(PageInfo.pszTitle, _T("Keyboards")) == 0)
        {
            m_DeviceType = 1;
        }
        else if(_tcsicmp(PageInfo.pszTitle, _T("Keypads")) == 0)
        {
            m_DeviceType = 5;
        }

        SetTimer(1, 500, NULL);
    }

    return Result;
}
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
	CMessageLoop theLoop;
	_Module.AddMessageLoop(&theLoop);

	//CMainDlg dlgMain;

	//if(dlgMain.Create(NULL) == NULL)
	//{
	//	ATLTRACE(_T("Main dialog creation failed!\n"));
	//	return 0;
	//}

	//dlgMain.ShowWindow(nCmdShow);

	CRgPropSheet ps(_T("PSSHETEE"));
	//CPropertySheetEx ps(IDS_PROPSHEET_CAPTION);
	CPropertyPage<IDD_DIALOG1> page;
	CPropertyPage<IDD_MAINDLG> page2;
	CPropertyPage<IDD_ABOUTBOX> page3;

	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(&ps);
	pLoop->AddIdleHandler(&ps);
	page.SetTitle(_T("1234"));
	ps.AddPage(page);
	ps.AddPage(page2);
	ps.AddPage(page);
	ps.AddPage(page3);
	//ps.Create(this.m_hWnd);
	ps.DoModal();
	::PostQuitMessage(1);

	int nRet = theLoop.Run();

	_Module.RemoveMessageLoop();
	return nRet;
}
Exemple #23
0
BOOL CAmbientEffectDlg::OnInitDialog()
{
    BOOL Result = CDialogEx::OnInitDialog();

    CPropertyPage* pPage = (CPropertyPage*)m_pParent;
    PROPSHEETPAGE PageInfo = pPage->GetPSP();

    if(_tcsicmp(PageInfo.pszTitle, _T("Keyboards")) == 0)
    {
        m_DeviceType = 1;
    }
    else if(_tcsicmp(PageInfo.pszTitle, _T("Mousemats")) == 0)
    {
        m_DeviceType = 2;
    }
    else if(_tcsicmp(PageInfo.pszTitle, _T("Keypads")) == 0)
    {
        m_DeviceType = 5;
    }

    return Result;
}
/*
	OnSelchangingTree()
*/
void CWallPaperCrawlerSettingsDlg::OnSelchangingTree(NMHDR* /*pNMHDR*/,LRESULT* pResult)
{
    if(m_bCreated)
    {
        HTREEITEM hCurrent = m_wndSettingsTree.GetSelectedItem();
        if(hCurrent)
        {
            CPropertyPage* pPropertyPage = (CPropertyPage*)m_wndSettingsTree.GetItemData(hCurrent);
            if(pPropertyPage)
            {
                if(pPropertyPage->IsKindOf(RUNTIME_CLASS(CWallPaperCrawlerSettingsDomainDlg)))
                {
                    CWallPaperCrawlerSettingsDomainDlg* pPage = (CWallPaperCrawlerSettingsDomainDlg*)pPropertyPage;
                    m_nDomainAcceptance = pPage->GetDomainAcceptance();
                    m_bIncludeSubDomains = pPage->GetIncludeSubDomains();
                    m_bDomainUseAlways = pPage->GetDomainUseAlways();
                    m_bSaveList = pPage->GetSaveList();
                }
                else if(pPropertyPage->IsKindOf(RUNTIME_CLASS(CWallPaperCrawlerSettingsParentUrlDlg)))
                {
                    CWallPaperCrawlerSettingsParentUrlDlg* pPage = (CWallPaperCrawlerSettingsParentUrlDlg*)pPropertyPage;
                    m_nParentUrlAcceptance = pPage->GetParentUrlAcceptance();
                    m_bParentUrlUseAlways= pPage->GetParentUrlUseAlways();
                    m_bSaveList = pPage->GetSaveList();
                }
                else if(pPropertyPage->IsKindOf(RUNTIME_CLASS(CWallPaperCrawlerSettingsWildcardsDlg)))
                {
                    CWallPaperCrawlerSettingsWildcardsDlg* pPage = (CWallPaperCrawlerSettingsWildcardsDlg*)pPropertyPage;
                    m_bSaveList = pPage->GetSaveList();
                }

                pPropertyPage->ShowWindow(SW_HIDE);
            }
        }
    }

    *pResult = 0;
}
BOOL CPropertyPageHost::SetActivePage(int nIndex, BOOL bAndFocus)
{
	if (nIndex < 0 || nIndex >= m_aPages.GetSize())
		return FALSE;

	CPropertyPage* pPage = m_aPages[nIndex].pPage;

	if (!pPage)
		return FALSE;

	CWnd* pFocus = GetFocus();

	if (!EnsurePageCreated(nIndex))
		return FALSE;

	// hide the current page provided it's not just about to be reshown
	BOOL bSamePage = (m_nSelIndex == nIndex);

	if (!bSamePage)
	{
		if (m_nSelIndex != -1)
		{
			CPropertyPage* pCurPage = GetActivePage();
			ASSERT (pCurPage);

			if (pCurPage)
			{
				pCurPage->ShowWindow(SW_HIDE);
				pCurPage->OnKillActive();
			}
		}

		UpdatePageSize(nIndex);
		pPage->OnSetActive();
		pPage->ShowWindow(SW_SHOW);

		// move the focus to the first dlg ctrl
		if (bAndFocus)
		{
			CWnd* pCtrl = pPage->GetNextDlgTabItem(NULL);

			if (pCtrl)
				pCtrl->SetFocus();
		}
		else
			pFocus->SetFocus();

		m_nSelIndex = nIndex;
	}

	return TRUE;
}
void CCodComplexAtributeView::UpdateSelection()
{
	ASSERT_VALID(m_SplitterFrame);

	CQmonntDoc *pDoc = dynamic_cast<CQmonntDoc *>(GetDocument());
	ASSERT_VALID(pDoc);

	CNodeInfoSet *pSelection = m_SplitterFrame->GetTreeSelection();
	ASSERT(NULL != pSelection);
	pDoc->GetComplexAtributeSet(&m_LocalComplexAtributeSet, pSelection);

	DPRINTF(("***************** ComplexAtributeSet **********************"));
	m_LocalComplexAtributeSet.DebugOut();

	m_ComplexAtributePage.SetLocalComplexAtributeSet(&m_LocalComplexAtributeSet);

	CPropertyPage *ActivePage = m_PropertySheet.GetActivePage();
	ASSERT_VALID(ActivePage);
	ActivePage->OnInitDialog();

	SetModified(m_LocalComplexAtributeSet.IsModified());
	SetLocal(m_LocalComplexAtributeSet.IsLocal());
	SetAged(false);
}
/*
	OnSelchangedTree()
*/
void CWallPaperCrawlerSettingsDlg::OnSelchangedTree(NMHDR* /*pNMHDR*/,LRESULT* pResult)
{
    if(m_bCreated)
    {
        HTREEITEM hCurrent = m_wndSettingsTree.GetSelectedItem();
        if(hCurrent)
        {
            CPropertyPage* pPropertyPage = (CPropertyPage*)m_wndSettingsTree.GetItemData(hCurrent);
            if(pPropertyPage)
            {
                m_ctrlSettingsArea.SetText("");
                m_ctrlSettingsArea.ShowWindow(SW_HIDE);

                if(pPropertyPage->IsKindOf(RUNTIME_CLASS(CWallPaperCrawlerSettingsDomainDlg)))
                {
                    CWallPaperCrawlerSettingsDomainDlg* pPage = (CWallPaperCrawlerSettingsDomainDlg*)pPropertyPage;
                    pPage->SetDomainAcceptance(m_nDomainAcceptance);
                    pPage->SetIncludeSubDomains(m_bIncludeSubDomains);
                    pPage->SetDomainUseAlways(m_bDomainUseAlways);
                    pPage->SetSaveList(m_bSaveList);
                }
                else if(pPropertyPage->IsKindOf(RUNTIME_CLASS(CWallPaperCrawlerSettingsParentUrlDlg)))
                {
                    CWallPaperCrawlerSettingsParentUrlDlg* pPage = (CWallPaperCrawlerSettingsParentUrlDlg*)pPropertyPage;
                    pPage->SetParentUrlAcceptance(m_nParentUrlAcceptance);
                    pPage->SetParentUrlUseAlways(m_bParentUrlUseAlways);
                    pPage->SetSaveList(m_bSaveList);
                }
                else if(pPropertyPage->IsKindOf(RUNTIME_CLASS(CWallPaperCrawlerSettingsWildcardsDlg)))
                {
                    CWallPaperCrawlerSettingsWildcardsDlg* pPage = (CWallPaperCrawlerSettingsWildcardsDlg*)pPropertyPage;
                    pPage->SetSaveList(m_bSaveList);
                }

                pPropertyPage->ShowWindow(SW_SHOW);
                pPropertyPage->OnSetActive();
            }
            else
            {
                m_ctrlSettingsArea.SetText(IDS_DIALOG_CRAWLER_SETTINGS_TITLE);
                m_ctrlSettingsArea.ShowWindow(SW_SHOW);
            }
        }
    }

    *pResult = 0;
}
Exemple #28
0
void CTutorialDlg::OnTimer(UINT_PTR nIDEvent)
{
    CPropertyPage* pPage = (CPropertyPage*)m_pParent;
    PROPSHEETPAGE PageInfo = pPage->GetPSP();

    if(nIDEvent == 1)
    {
        UINT VKey = 0x57;       // W
        static BOOL Blink = TRUE;
        if(Blink == TRUE)
        {
            m_ChromaSDKImpl.ShowKeys(m_DeviceType, 1, &VKey, WHITE);
            Blink = FALSE;
        }
        else
        {
            m_ChromaSDKImpl.ShowKeys(m_DeviceType, 0, NULL, WHITE);
            Blink = TRUE;
        }
    }
    else if(nIDEvent == 2)
    {
        UINT VKeys [2] = { {0x57}, {0x41} };    // W, A
        static BOOL Blink = TRUE;
        if(Blink == TRUE)
        {
            m_ChromaSDKImpl.ShowKeys(m_DeviceType, 2, VKeys, WHITE);
            Blink = FALSE;
        }
        else
        {
            m_ChromaSDKImpl.ShowKeys(m_DeviceType, 1, VKeys, WHITE);
            Blink = TRUE;
        }
    }
    else if(nIDEvent == 3)
    {
        UINT VKeys [3] = { {0x41}, {0x57}, {0x53} };    // W, A, S
        static BOOL Blink = TRUE;
        if(Blink == TRUE)
        {
            m_ChromaSDKImpl.ShowKeys(m_DeviceType, 3, VKeys, WHITE);
            Blink = FALSE;
        }
        else
        {
            m_ChromaSDKImpl.ShowKeys(m_DeviceType, 2, VKeys, WHITE);
            Blink = TRUE;
        }
    }
    else if(nIDEvent == 4)
    {
        UINT VKeys [4] = { {0x41}, {0x57}, {0x53}, {0x44} };    // W, A, S, D
        static BOOL Blink = TRUE;
        if(Blink == TRUE)
        {
            m_ChromaSDKImpl.ShowKeys(m_DeviceType, 4, VKeys, WHITE);
            Blink = FALSE;
        }
        else
        {
            m_ChromaSDKImpl.ShowKeys(m_DeviceType, 3, VKeys, WHITE);
            Blink = TRUE;
        }
    }

    CDialogEx::OnTimer(nIDEvent);
}
LONG OptionsDialog::OnResizePage(UINT, LONG)
{
  CPropertyPage* page = GetActivePage();
  page->MoveWindow(&m_page);
  return 0;
}
void CExtChildResizablePropertySheet::_TrickSyncActviveChild()
{
CPropertyPage * pWnd = CPropertySheet::GetActivePage();
CTabCtrl * pTabCtrl = CPropertySheet::GetTabControl();
	if(		pWnd != NULL
		&&	pWnd->GetSafeHwnd() != NULL
		&&	::IsWindow( pWnd->GetSafeHwnd() )
		&&	pTabCtrl != NULL
		&&	pTabCtrl->GetSafeHwnd() != NULL
		&&	::IsWindow( pTabCtrl->GetSafeHwnd() )
		)
	{

		if( !m_bTabStylesInitialized )
		{
			m_bTabStylesInitialized = true;
			DWORD dwStylesRemove = 0L;
			DWORD dwStylesAdd = 0L;
			if( m_bInitTabSingleLine )
			{
				dwStylesRemove |= TCS_MULTILINE;
				dwStylesAdd |= TCS_SINGLELINE;
			}
			if( m_bInitTabButtons )
			{
				dwStylesAdd |= TCS_BUTTONS;
				if( m_bInitTabButtonsFlat )
					dwStylesAdd |= TCS_FLATBUTTONS;
			}
			if( dwStylesRemove != 0 || dwStylesAdd != 0 )
				pTabCtrl->ModifyStyle(
					dwStylesRemove,
					dwStylesAdd,
					SWP_FRAMECHANGED
					);
			if( m_bInitTabButtons && m_bInitTabButtonsFlat && m_bInitTabSeparatorsFlat )
				pTabCtrl->SetExtendedStyle( TCS_EX_FLATSEPARATORS, TCS_EX_FLATSEPARATORS );
		}
		
		RECT lpRect;
		GetClientRect(&lpRect);
		// dirty fix of the access vialation bug of
		// the tab control with single item when item's
		// width/height is same as tab control width/height
		__try
		{
			pTabCtrl->AdjustRect(FALSE, &lpRect);
		}
		__except( EXCEPTION_EXECUTE_HANDLER )
		{
			lpRect.right ++;
			lpRect.bottom ++;
			__try
			{
				pTabCtrl->AdjustRect(FALSE, &lpRect);
			}
			__except( EXCEPTION_EXECUTE_HANDLER )
			{
			}
		}
		pWnd->MoveWindow(&lpRect, TRUE);   
	}
}