本文整理汇总了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);
}
}
示例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 );
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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));
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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)
}