当前位置: 首页>>代码示例>>C++>>正文


C++ CWinApp::WriteProfileInt方法代码示例

本文整理汇总了C++中CWinApp::WriteProfileInt方法的典型用法代码示例。如果您正苦于以下问题:C++ CWinApp::WriteProfileInt方法的具体用法?C++ CWinApp::WriteProfileInt怎么用?C++ CWinApp::WriteProfileInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CWinApp的用法示例。


在下文中一共展示了CWinApp::WriteProfileInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnBnClickedCheckPrelogins

void CLogin::OnBnClickedCheckPrelogins()
{
	// TODO: Add your control notification handler code here
	// IDC_CHECK_PRELOGINS
	CButton *cbox = (CButton *)GetDlgItem(IDC_CHECK_PRELOGINS);
	int n = cbox->GetCheck();

	CButton *add_button = (CButton *)GetDlgItem(IDC_LOGIN_NEW);
	CButton *remove_button = (CButton *)GetDlgItem(IDC_LOGIN_REMOVE);

	CWinApp* pApp = AfxGetApp();
	if(n == 0)  /* unchecked */
	{
		m_ListBox.ShowWindow(SW_HIDE);
		add_button->ShowWindow(SW_HIDE);
		remove_button->ShowWindow(SW_HIDE);

		pApp->WriteProfileInt("ShowPreviousLogins", "YesNo", 0);
	}
	else
	{
		m_ListBox.ShowWindow(SW_SHOW);
		add_button->ShowWindow(SW_SHOW);
		remove_button->ShowWindow(SW_SHOW);

		pApp->WriteProfileInt("ShowPreviousLogins", "YesNo", 1);
	}
}
开发者ID:DICE-UNC,项目名称:iRODS-FUSE-Mod,代码行数:28,代码来源:Login.cpp

示例2: saveSetting

void CChatViewerFont::saveSetting() const
{
	CWinApp* app = AfxGetApp();

	app->WriteProfileString( "Style\\Font", "name", name.c_str() );
	app->WriteProfileInt( "Style\\Font", "size", size );
	app->WriteProfileInt( "Style\\Font", "codepage", codepage );
	app->WriteProfileInt( "Style\\Font", "characterSet", characterSet );
}
开发者ID:aurusov,项目名称:localchat,代码行数:9,代码来源:chatviewerstyle.cpp

示例3: saveSetting

void AppSetting::saveSetting()
{
	CWinApp* pApp = AfxGetApp();
	pApp->WriteProfileInt(REGKEY_APP_NAME, REGKEY_SHOW_NAVIGATION, showNavigation? 1:0);

	pApp->WriteProfileInt(REGKEY_APP_NAME, REGKEY_DISPLAY_TEXT, bShowHelpText? 1:0);
	pApp->WriteProfileInt(REGKEY_APP_NAME, REGKEY_DISPLAY_AXIS, bShowAxis? 1:0);
	pApp->WriteProfileStringA(REGKEY_APP_NAME,REGKEY_OBJECT_PATH,objPath);
	pApp->WriteProfileStringA(REGKEY_APP_NAME,REGKEY_SIM_DATA_PATH,simulationDataPath);
}
开发者ID:pigoblock,项目名称:TFYP,代码行数:10,代码来源:AppSetting.cpp

示例4: SaveToIni

void CRunMap::SaveToIni(void)
{
	CWinApp *App = AfxGetApp();
	App->WriteProfileInt(pszSection, "CSG", m_iCSG);
	App->WriteProfileInt(pszSection, "QBSP", m_iQBSP);
	App->WriteProfileInt(pszSection, "Vis", m_iVis);
	App->WriteProfileInt(pszSection, "Light", m_iLight);
	App->WriteProfileInt(pszSection, "No Game", m_bNoQuake);
	App->WriteProfileString(pszSection, "Game Parms", m_strQuakeParms);
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:10,代码来源:runmap.cpp

示例5: Terminate

void CPadView::Terminate()
{
	CWinApp* pApp = AfxGetApp();
	if (m_nDefTabStops != m_nDefTabStopsOld)
		pApp->WriteProfileInt(szSettings, szTabStops, m_nDefTabStops);
	if (m_bDefWordWrap != m_bDefWordWrapOld)
		pApp->WriteProfileInt(szSettings, szWordWrap, m_bDefWordWrap);
	WriteProfileFont(szFont, &m_lfDefFont, &m_lfDefFontOld);
	WriteProfileFont(szPrintFont, &m_lfDefPrintFont, &m_lfDefPrintFontOld);
}
开发者ID:jetlive,项目名称:skiaming,代码行数:10,代码来源:padview.cpp

示例6: OnClose

//this code from codeguru by Yonat Sharon
void CStudioMainFrame::OnClose()
{    // Save main window position
	CWinApp* app = AfxGetApp();
	WINDOWPLACEMENT wp;    GetWindowPlacement(&wp);
	app->WriteProfileInt(_T("Frame"), _T("Status"), wp.showCmd);
	app->WriteProfileInt(_T("Frame"), _T("Top"),    wp.rcNormalPosition.top);
	app->WriteProfileInt(_T("Frame"), _T("Left"),   wp.rcNormalPosition.left);
	app->WriteProfileInt(_T("Frame"), _T("Bottom"), wp.rcNormalPosition.bottom);
	app->WriteProfileInt(_T("Frame"), _T("Right"),  wp.rcNormalPosition.right);

	CMDIFrameWnd::OnClose();
}
开发者ID:StephenMcConnel,项目名称:CarlaLegacy,代码行数:13,代码来源:CStudioMainFrm.cpp

示例7: WriteToRegistry

bool CEsmScriptOptions::WriteToRegistry (void) {
  CWinApp* pApp = AfxGetApp();
  bool	   Result;
  int	   iResult;

	/* Output the background color */
  iResult &= pApp->WriteProfileInt(ESMSCR_REGSEC_SCRIPT, ESMSCR_REGENTRY_BGCOLOR,    m_BackgroundColor);
  iResult &= pApp->WriteProfileInt(ESMSCR_REGSEC_SCRIPT, ESMSCR_REGENTRY_NOTOOLTIPS, (int) m_NoToolTips);

	/* Output the various char format and font options */
  Result  = WriteRegCharFormat();
  Result &= WriteRegFont();

  return (Result & (iResult != 0));
 }
开发者ID:Purr4me,项目名称:TES5Edit-GoogleCode,代码行数:15,代码来源:EsmScriptOptions.cpp

示例8: WriteProfileInt

//--------------------------------------------------------------------------------------------------------------//
BOOL CChildView::WriteProfileInt(LPCTSTR lpszEntry, int nValue)
{
	BOOL bOk = FALSE;
	CWinApp* pApp = AfxGetApp();
	if (pApp) bOk = pApp->WriteProfileInt(REG_SECTION_LOG, lpszEntry, nValue);
	return bOk;
}
开发者ID:AlexS2172,项目名称:IVRMstandard,代码行数:8,代码来源:ChildView.cpp

示例9: OnDestroy

void CMainFrame::OnDestroy()
{
	CFrameWnd::OnDestroy();

	// TODO: 여기에 메시지 처리기 코드를 추가합니다.

	//deep01 : 레지스트리에 저장한 윈도우 크기, 위치보관
	CWinApp* pApp = (CWinApp*)AfxGetApp();
	CRect rect;
	GetWindowRect(rect);
	pApp->WriteProfileInt(m_Section, "left", rect.left);
	pApp->WriteProfileInt(m_Section, "top", rect.top);
	pApp->WriteProfileInt(m_Section, "right", rect.right);
	pApp->WriteProfileInt(m_Section, "bottom", rect.bottom);

}
开发者ID:woongbini,项目名称:2015_second_semester,代码行数:16,代码来源:MainFrm.cpp

示例10: WriteRegFont

bool CEsmScriptOptions::WriteRegFont (void) {
  CWinApp* pApp = AfxGetApp();
  LOGFONT  LogFont;
  int	   iResult;

	/* Attempt to get the font information */
  iResult = m_TextFont.GetLogFont(&LogFont);
  if (iResult == 0) return (false);
  
	/* Write the font options to the registry */
  iResult  = pApp->WriteProfileInt(ESMSCR_REGSEC_SCRIPT, ESMSCR_REGENTRY_FONTSIZE, LogFont.lfHeight);
  iResult &= pApp->WriteProfileInt(ESMSCR_REGSEC_SCRIPT, ESMSCR_REGENTRY_FONTBOLD,  LogFont.lfWeight);
  iResult &= pApp->WriteProfileInt(ESMSCR_REGSEC_SCRIPT, ESMSCR_REGENTRY_FONTITALIC, LogFont.lfItalic);
  iResult &= pApp->WriteProfileString(ESMSCR_REGSEC_SCRIPT, ESMSCR_REGENTRY_FONTNAME, LogFont.lfFaceName);

  return (iResult != 0);
 }
开发者ID:Purr4me,项目名称:TES5Edit-GoogleCode,代码行数:17,代码来源:EsmScriptOptions.cpp

示例11: OnOK

void CTipDlg::OnOK()
{
	CDialog::OnOK();
	
    // Update the startup information stored in the INI file
	CWinApp* pApp = AfxGetApp();
	pApp->WriteProfileInt(szSection, szIntStartup, !m_bStartup);
}
开发者ID:chengouxuan,项目名称:UCCI_ChessEngines,代码行数:8,代码来源:TipDlg.cpp

示例12: WriteProfileFont

static void WriteProfileFont(LPCTSTR szSec, const LOGFONT* plf, LOGFONT* plfOld)
{
	CWinApp* pApp = AfxGetApp();

	if (plf->lfHeight != plfOld->lfHeight)
		pApp->WriteProfileInt(szSec, szHeight, plf->lfHeight);
	if (plf->lfHeight != 0)
	{
		if (plf->lfHeight != plfOld->lfHeight)
			pApp->WriteProfileInt(szSec, szHeight, plf->lfHeight);
		if (plf->lfWeight != plfOld->lfWeight)
			pApp->WriteProfileInt(szSec, szWeight, plf->lfWeight);
		if (plf->lfItalic != plfOld->lfItalic)
			pApp->WriteProfileInt(szSec, szItalic, plf->lfItalic);
		if (plf->lfUnderline != plfOld->lfUnderline)
			pApp->WriteProfileInt(szSec, szUnderline, plf->lfUnderline);
		if (plf->lfPitchAndFamily != plfOld->lfPitchAndFamily)
			pApp->WriteProfileInt(szSec, szPitchAndFamily, plf->lfPitchAndFamily);
		if (plf->lfCharSet != plfOld->lfCharSet)
			pApp->WriteProfileInt(szSec, szCharSet, plf->lfCharSet);
		if (_tcscmp(plf->lfFaceName, plfOld->lfFaceName) != 0)
			pApp->WriteProfileString(szSec, szFaceName, (LPCTSTR)plf->lfFaceName);
	}
	*plfOld = *plf;
}
开发者ID:jetlive,项目名称:skiaming,代码行数:25,代码来源:padview.cpp

示例13: OnLoginNew

//Creating a new login profile
void CLogin::OnLoginNew() 
{
	CString name, host, zone, port;

	m_NameCombobox.GetWindowText(name);
	m_HostCombobox.GetWindowText(host);
	m_ZoneCombobox.GetWindowText(zone);
	m_PortCombobox.GetWindowText(port);

	CString new_profile_id = name + " in " + zone + " at " + host + " | " + port;

	CString tmp;

	for(int i = 0; i < m_ListBox.GetItemCount(); i++)
	{
		//tmp = m_ListBox.GetItemText(i, 0);
		tmp = m_prevLogins[i];
		if(0 == new_profile_id.Compare(tmp))
			return;		//the profile already exists - do nothing
	}

	CWinApp* pApp = AfxGetApp();

	char buf[256];

	UINT latest = pApp->GetProfileInt("History", "Latest", 0);

	if(0 == latest)
	{
		//there is no history - begin a new one.
		//never store anything in "History\\0"!
		latest = 1;
		sprintf(buf, "History\\1");
	}
	else
	{
		//create a new slot
		sprintf(buf, "History\\%d", ++latest);
	}

	//adding the new profile to the registry and incrementing latest
	pApp->WriteProfileInt("History", "Latest", latest);
	pApp->WriteProfileString(buf, "Name", name);
	pApp->WriteProfileString(buf, "Host", host);
	pApp->WriteProfileString(buf, "Zone", zone);
	pApp->WriteProfileString(buf, "Port", port);

	//add the new profile to the listbox - remember listbox is always one behind the registry!
	//m_ListBox.InsertItem(latest-1, new_profile_id, 0);
	int n = m_ListBox.InsertItem(latest-1, name);
	latest++;
	m_ListBox.SetItemText(n, 1, zone);
	m_ListBox.SetItemText(n, 2, host);
	m_ListBox.SetItemText(n, 3, port);

	m_prevLogins.Add(new_profile_id);
}
开发者ID:DICE-UNC,项目名称:iRODS-FUSE-Mod,代码行数:58,代码来源:Login.cpp

示例14: WriteList

void CXTPRecentFileList::WriteList()
{
	ASSERT(m_arrNames != NULL);
	ASSERT(!m_strSectionName.IsEmpty());
	ASSERT(!m_strEntryFormat.IsEmpty());
	LPTSTR pszEntry = new TCHAR[max(20, m_strEntryFormat.GetLength() + 7)];

	CWinApp* pApp = AfxGetApp();
	pApp->WriteProfileString(m_strSectionName, NULL, NULL);

	for (int iMRU = 0; iMRU < m_nSize; iMRU++)
	{
		if (m_pItems[iMRU] && !m_arrNames[iMRU].IsEmpty())
		{
			wsprintf(pszEntry, m_strEntryFormat, iMRU + 1);
			pApp->WriteProfileString(m_strSectionName, pszEntry, m_arrNames[iMRU]);

			if (m_pItems[iMRU]->IsPinned())
			{
				wsprintf(pszEntry, _T("Pinned%d"), iMRU + 1);
				pApp->WriteProfileInt(m_strSectionName, pszEntry, 1);
			}

			if (!m_pItems[iMRU]->GetCaption().IsEmpty())
			{
				wsprintf(pszEntry, _T("Caption%d"), iMRU + 1);
				pApp->WriteProfileString(m_strSectionName, pszEntry, m_pItems[iMRU]->GetCaption());
			}

			if (!m_pItems[iMRU]->GetTag().IsEmpty())
			{
				wsprintf(pszEntry, _T("Tag%d"), iMRU + 1);
				pApp->WriteProfileString(m_strSectionName, pszEntry, m_pItems[iMRU]->GetTag());
			}

			if (m_pItems[iMRU]->GetIconId() != -1)
			{
				wsprintf(pszEntry, _T("IconId%d"), iMRU + 1);
				pApp->WriteProfileInt(m_strSectionName, pszEntry, m_pItems[iMRU]->GetIconId());
			}
		}
	}
	delete[] pszEntry;
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:44,代码来源:XTPRecentFileList.cpp

示例15: LANG_T

int LANG_T(int l) {
  if (l>=0) {
    QLANG_T(l);
    CWinApp* pApp = AfxGetApp();
    if (pApp)
      pApp->WriteProfileInt("Language","IntId",l);
    LANG_LOAD(NULL);
  }
  return QLANG_T(-1);  // 0=default (english)
}
开发者ID:Mr-Kumar-Abhishek,项目名称:httrack-windows,代码行数:10,代码来源:newlang.cpp


注:本文中的CWinApp::WriteProfileInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。