//
// config
//
const int HKEY hKey = HKEY_CURRENT_USER;
const CString REGPATH = _T("Software\\WebFTP");
//
// Read
//
CRegistryEx env(hKey);
int retVal;
CString regItem;
char temp[1024];
int i;
if (env.VerifyKey(REGPATH))
{
env.Open(hKey, REGPATH);
for (i = 0; i < 7; i ++ )
{
regItem.Format(_T("Address%d"), i);
retVal = env.Read(regItem, temp, 1024);
if (retVal)
{
m_wndToolBar.m_addressBar.AddString(temp);
}
else break;
}
if (i) m_wndToolBar.m_addressBar.SetCurSel(0);
env.Close();
}
//
// Write
//
CRegistryEx env( hKey );
RECT rect;
AfxGetMainWnd()->GetWindowRect( &rect );
if (!env.VerifyKey(REGPATH))
{
env.CreateKey(hKey, REGPATH);
env.Close();
}
env.Open(hKey, REGPATH);
env.Write("SX", rect.left);
env.Write("SY", rect.top);
env.Write("EX", rect.right);
env.Write("EY", rect.bottom);
env.Close();
'Windows > MFC' 카테고리의 다른 글
CImageList (0) | 2013.10.02 |
---|---|
CHtmlView SetTheaterMode 테두리 제거 (0) | 2013.10.02 |
MultiByteToWideChar char->wchar_t 유니코드 (0) | 2013.10.02 |
Class registry (0) | 2013.10.02 |
CRegKey How to!, registry (0) | 2013.10.02 |