Exemple #1
0
LRESULT CEasyPage1::OnWizardNext() 
{
	// TODO: Add your specialized code here and/or call the base class
	
	// return CPropertyPage::OnWizardNext();

	CPropertySheet* pSheet = (CPropertySheet*)GetParent();
	ASSERT_KINDOF(CPropertySheet, pSheet);

	// invalid m_nBackupContent
	m_nBackupContent=-1;

	UpdateData(TRUE);
	
	if( 0 == m_nBackupContent )
	{
	   g_EasyBackupInfo.nBackupContent = m_nBackupContent;
	   return ( pSheet->SetActivePage(pSheet->GetPage(2)) );
	}
	else if (
		       (1 == m_nBackupContent) ||
		       (2 == m_nBackupContent)
			)
	{
	   g_EasyBackupInfo.nBackupContent = m_nBackupContent;
	   return CPropertyPage::OnWizardNext();
	}
	else
	{
		TRACE(L"\nYou do not choose a number.");
		return -1;
	}

	// return CPropertyPage::OnWizardNext();
}
LRESULT DrvDeletePage::OnWizardBack()
{
	CPropertySheet* pSheet = (CPropertySheet*)GetParent();
	ASSERT_KINDOF(CPropertySheet, pSheet);
	pSheet->SetActivePage(1);

	return CPropertyPage::OnWizardBack();
}
/*!
 *  This function loads the active page using the base class persist method.
 *  @sa CResizableState::ReadState
 *
 *  @param pszName String that identifies stored settings
 *
 *  @return Returns @a TRUE if successful, @a FALSE otherwise
 */
BOOL CResizableSheetState::LoadPage(LPCTSTR pszName)
{
    // restore active page, zero (the first) if not found

    CString data, id;
    id = CString(pszName) + ACTIVEPAGE_ENT;
    if (!ReadState(id, data))
        return FALSE;

    int page = _ttoi(data);
    CPropertySheet* pSheet = DYNAMIC_DOWNCAST(CPropertySheet, GetResizableWnd());
    if (pSheet != NULL)
        return pSheet->SetActivePage(page);
    return FALSE;
}
	BOOL ShowApplet(HWND hWnd, LONG_PTR /*lData*/, LPCTSTR pstrCommand)
	{
		BOOL bWithFingerMenu = FALSE;
		CString szPath;
		CString szProgramFilesFolder;
		WCHAR szInstallDir[MAX_PATH];
		WCHAR szValue[MAX_PATH];
		ZeroMemory(szValue, sizeof(szValue));
		if (SHGetSpecialFolderPath(NULL, szValue, CSIDL_PROGRAM_FILES, FALSE))
		{
			szProgramFilesFolder.Format(L"%s", szValue);
		}
		if (RegistryGetString(HKEY_LOCAL_MACHINE, L"Software\\FingerMenu", L"InstallDir", szInstallDir, MAX_PATH) == S_OK)
		{
			szPath.Format(L"%s\\FingerMenu.exe", szInstallDir);
		}
		else
		{
			szPath = szProgramFilesFolder + L"\\FingerMenu\\FingerMenu.exe";
		}
		
		CFindFile finder; 
		if (finder.FindFile(szPath))
		{
			bWithFingerMenu = TRUE;
		}



		dlg1.SetTitle(L"Startup");
		dlg1.m_bWithFingerMenu = bWithFingerMenu;
		if (bWithFingerMenu)
		{
			dlg2.SetTitle(L"Menu options");
			dlg3.SetTitle(L"Menu exclusions");
			dlg7.SetTitle(L"Menu wnd exclusions");
		}
		dlg5.SetTitle(L"Msgbox options");
		dlg6.SetTitle(L"Msgbox exclusions");
		dlg8.SetTitle(L"Msgbox wnd exclusions");
		dlg4.SetTitle(L"Skins");
		dlg4.m_bWithFingerMenu = bWithFingerMenu;
		dlgAbout.SetTitle(L"About");

		// about box
		CString strCredits = "\n\n"
			    "\tFingerMenu v1.12\n\n"
				"\tFingerMsgBox v1.01\n\n"
				"\rdeveloped by:\n"
				"Francesco Carlucci\n"
				"<*****@*****.**>\n"
				"\n\n"
				"http://forum.xda-developers.com/\n"
				"                showthread.php?t=459125\n";

		dlgAbout.SetCredits(strCredits);

		CPropertySheet sheet;
		sheet.AddPage(dlg1);
		if (bWithFingerMenu)
		{
			sheet.AddPage(dlg2);
			sheet.AddPage(dlg3);
			sheet.AddPage(dlg7);
		}
		sheet.AddPage(dlg5);
		sheet.AddPage(dlg6);
		sheet.AddPage(dlg8);
		sheet.AddPage(dlg4);
		sheet.AddPage(dlgAbout);
		sheet.SetActivePage(_ttol(pstrCommand));
		if (IDOK == sheet.DoModal(hWnd))
		{
			ReloadConfiguration();
		}

		return TRUE;
	}
/**
 * check dialog data.
 *
 * @param           -
 * @return          dialog data correct?
 * @exception       -
 * @see             -
*/
BOOL CPropPageTargetGeneral::CheckDialogData()
{
    m_tResourceCombo.GetWindowText(m_strResource);

    // if name changed, check it
    if(m_bNameChanged)
    {
        // check name: it should be a valid IEC identifier
        HRESULT                     hr;
        enum E_IEC_IDENTIFIER_ERROR error;
        CComBSTR                    sName(m_strName);

        hr = m_pProjInfo->CheckIECIdentifier(sName, &error);
        if (hr!=S_OK)
        {
            CPropertySheet* pPropSheet = dynamic_cast<CPropertySheet*>(GetParent());
            if(pPropSheet)
            {
                pPropSheet->SetActivePage(this);
            }

            // goto name edit
            CWnd*   pTmp = GetDlgItem(IDC_PROPGEN_NAME);
            if(pTmp)
            {
                GotoDlgCtrl(pTmp);
            }

            if (error==IDENTIFIER_SYNTAX_ERROR)
            {
                CString errorMsg;
                errorMsg.FormatMessage(IDS_ERROR_IDENTIFIER_SYNTAX_ERROR,
                                       m_strName);
                ::AfxMessageBox(errorMsg, MB_OK|MB_ICONERROR);
            }
            else if (error==IDENTIFIER_IS_KEYWORD)
            {
                CString errorMsg;
                errorMsg.FormatMessage(IDS_ERROR_IDENTIFIER_IS_KEYWORD,
                                       m_strName);
                ::AfxMessageBox(errorMsg, MB_OK|MB_ICONERROR);
            }
            else if (error==IDENTIFIER_TOO_LONG)
            {
                CString errorMsg;
                errorMsg.FormatMessage(IDS_ERROR_IDENTIFIER_TOO_LONG,
                                       m_strName);
                ::AfxMessageBox(errorMsg, MB_OK|MB_ICONERROR);
            }
            else
            {
                CString errorMsg;
                errorMsg.FormatMessage(IDS_ERROR_IDENTIFIER,
                                       m_strName);
                ::AfxMessageBox(errorMsg, MB_OK|MB_ICONERROR);
            }

            return FALSE;
        }
    }
    return TRUE;
}