/* * Add this source with appropriate configuration keys to the registry. */ void addRegistryInfo(wchar_t *source) { const wchar_t *prefix = L"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\"; DWORD disposition; HKEY hkey = 0; wchar_t subkey[256]; wcscpy(subkey, prefix); wcscat(subkey, source); hkey = regGetKey(subkey, &disposition); if (disposition == REG_CREATED_NEW_KEY) { HMODULE hmodule = gModule; if (hmodule == NULL) { hmodule = GetModuleHandleW(L"NTEventLogAppender.dll"); } if (hmodule != NULL) { wchar_t modpath[_MAX_PATH]; DWORD modlen = GetModuleFileNameW(hmodule, modpath, _MAX_PATH - 1); if (modlen > 0) { modpath[modlen] = 0; regSetString(hkey, L"EventMessageFile", modpath); regSetString(hkey, L"CategoryMessageFile", modpath); } } regSetDword(hkey, L"TypesSupported", (DWORD)7); regSetDword(hkey, L"CategoryCount", (DWORD) 6); } RegCloseKey(hkey); return; }
BOOL CPageMp3::OnApply() { regSetDword(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"mp3_PropEnable",(DWORD )m_bMp3PropEnable); regSetDword(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"mp3_Id3v1ScmpxGenre",(DWORD )m_bId3v1ScmpxGenre); regSetDword(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"mp3_RiffSifDisable",(DWORD )m_bRiffSifDisable); regSetString(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"mp3_RmpSoft",m_strRiffSoft); regSetDword(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"mp3_InfotipEnable",(DWORD )m_bInfotipEnable); regSetString(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"mp3_InfotipFormat",m_strInfotipFormat); regSetDword(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"mp3_ColumnEnable",(DWORD )m_bColumnEnable); return CPropertyPage::OnApply(); }
BOOL CPageVqf::OnApply() { regSetDword(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"vqf_PropEnable",(DWORD )m_bPropEnable); regSetDword(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"vqf_InfotipEnable",(DWORD )m_bInfotipEnable); regSetString(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"vqf_InfotipFormat",m_strInfotipFormat); regSetDword(HKEY_CURRENT_USER,MP3INFP_REG_ENTRY,"vqf_ColumnEnable",(DWORD )m_bColumnEnable); return CPropertyPage::OnApply(); }
/* * Add this source with appropriate configuration keys to the registry. */ void NTEventLogAppender::addRegistryInfo(const char *source) { const TCHAR *prefix = "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\"; DWORD disposition; HKEY hkey = 0; TCHAR subkey[256]; lstrcpy(subkey, prefix); lstrcat(subkey, source); hkey = regGetKey(subkey, &disposition); if (disposition == REG_CREATED_NEW_KEY) { regSetString(hkey, "EventMessageFile", "NTEventLogAppender.dll"); regSetString(hkey, "CategoryMessageFile", "NTEventLogAppender.dll"); regSetDword(hkey, "TypesSupported", (DWORD)7); regSetDword(hkey, "CategoryCount", (DWORD)8); } RegCloseKey(hkey); return; }
/* * Add this source with appropriate configuration keys to the registry. */ void addRegistryInfo(char *source) { const TCHAR *prefix = "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\"; DWORD disposition; HKEY hkey = 0; TCHAR subkey[256]; lstrcpy(subkey, prefix); lstrcat(subkey, source); hkey = regGetKey(subkey, &disposition); if (disposition == REG_CREATED_NEW_KEY) { regSetString(hkey, "EventMessageFile", "NTEventLogAppender.dll"); regSetString(hkey, "CategoryMessageFile", "NTEventLogAppender.dll"); regSetDword(hkey, "TypesSupported", (DWORD)7); regSetDword(hkey, "CategoryCount", (DWORD)8); } //RegSetValueEx(hkey, "EventMessageFile", 0, REG_SZ, (LPBYTE)dllname, lstrlen(dllname)); //RegSetValueEx(hkey, "CategoryMessageFile", 0, REG_SZ, (LPBYTE)dllname, lstrlen(dllname)); //RegSetValueEx(hkey, "TypesSupported", 0, REG_DWORD, (LPBYTE)&whichTypes, sizeof(DWORD)); //RegSetValueEx(hkey, "CategoryCount", 0, REG_DWORD, (LPBYTE)&numCategories, sizeof(DWORD)); RegCloseKey(hkey); return; }
STDAPI DllRegisterServer() { AFX_MANAGE_STATE(AfxGetStaticModuleState()); TCHAR szDllPath[MAX_PATH]; GetModuleFileName(AfxGetInstanceHandle(),szDllPath,MAX_PATH); //コンポーネントの登録 regSetString(HKEY_CLASSES_ROOT,_T("CLSID\\") CLSID_STR_ShellExt,_T(""),APP_NAME); regSetString(HKEY_CLASSES_ROOT,_T("CLSID\\") CLSID_STR_ShellExt _T("\\InProcServer32"),_T(""),szDllPath); regSetString(HKEY_CLASSES_ROOT,_T("CLSID\\") CLSID_STR_ShellExt _T("\\InProcServer32"),_T("ThreadingModel"),_T("Apartment")); //Approved regSetString(HKEY_LOCAL_MACHINE,_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),CLSID_STR_ShellExt,APP_NAME); //関連付けの設定を維持する設定 //2003-08-10 インストーラに移動 // char szRegExePath[MAX_PATH]; // regGetString(HKEY_LOCAL_MACHINE,MP3INFP_REG_ENTRY,_T("path"),szRegExePath,_T("")); // AddTailYenSign(szRegExePath); // strcat(szRegExePath,_T("mp3infp_regist.exe")); // regSetString(HKEY_LOCAL_MACHINE,_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"),APP_NAME,szRegExePath); //関連付け //(ContextMenu) regSetString(HKEY_CLASSES_ROOT,_T("*\\shellex\\ContextMenuHandlers\\mp3infp"),_T(""),CLSID_STR_ShellExt); //(Property) regSetString(HKEY_CLASSES_ROOT,_T("*\\shellex\\PropertySheetHandlers\\mp3infp"),_T(""),CLSID_STR_ShellExt); for(int i=0; i<sizeof_array(extlist); i++) { //(InfoTip) CString strKey = extlist[i]; strKey += _T("\\shellex\\{00021500-0000-0000-C000-000000000046}"); regExSet(strKey,CLSID_STR_ShellExt); } //ドライブ // regSetString(HKEY_CLASSES_ROOT,_T("Drive\\shellex\\PropertySheetHandlers\\") CLSID_STR_ShellExt,_T(""),_T("mp3infp")); regSetString(HKEY_CLASSES_ROOT,_T("Folder\\shellex\\ColumnHandlers\\") CLSID_STR_ShellExt,_T(""),_T("mp3infp")); return S_OK; }