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; }
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; }
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; }
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); }