From: qwerty2501 Date: Sat, 25 Feb 2012 09:27:00 +0000 (+0900) Subject: 規定のブラウザとのクッキー共有機能実装 X-Git-Tag: v0.100~7 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e1eb437b2ef69b809001bae979337f2110d99eb0;p=nlite%2Fnlite.git 規定のブラウザとのクッキー共有機能実装 --- diff --git a/nlite.suo b/nlite.suo index 6f5dc72..d5f488b 100644 Binary files a/nlite.suo and b/nlite.suo differ diff --git a/nlite/nlite_property.cpp b/nlite/nlite_property.cpp index 092e06f..83cb135 100644 --- a/nlite/nlite_property.cpp +++ b/nlite/nlite_property.cpp @@ -95,7 +95,7 @@ namespace nlite{ numberNameFlag(FALSE), autoColorRegisterFlag(FALSE), activeCountTimeFlag(TRUE), - browserType(BT_INTERNET_EXPLORER), + browserType(BT_DEFAULT), ncvUserSettingReadedFlag(FALSE) {} diff --git a/nlite/nlite_propertyWindow.cpp b/nlite/nlite_propertyWindow.cpp index ad46f74..7348706 100644 --- a/nlite/nlite_propertyWindow.cpp +++ b/nlite/nlite_propertyWindow.cpp @@ -51,6 +51,7 @@ BOOL CCookieSettingWindow::OnInitDialog(CWindow wndFocus, LPARAM lInitParam){ case BT_DEFAULT: radio = GetDlgItem(IDC_DEFAULT_BT_RADIO); + break; default: goto skip; diff --git a/shareCookie/shareCookie.c b/shareCookie/shareCookie.c index 2a77b4d..6525cd6 100644 --- a/shareCookie/shareCookie.c +++ b/shareCookie/shareCookie.c @@ -947,9 +947,8 @@ fileopenerr: BROWSERTYPE getDefaultBrowserType(){ BROWSERTYPE rslt = BT_NOSETTING; - WCHAR currentUserSID[_MAX_PATH]; - DWORD cName = ARRAY_LENGTH(currentUserSID); - FILETIME fileTime; + WCHAR browserName[_MAX_PATH]; + DWORD cName = sizeof(browserName); HKEY hKey; //ƒŒƒWƒXƒgƒŠƒL[‚ð“Ç‚ÝŽæ‚èê—p‚ŃI[ƒvƒ“ if(RegOpenKeyEx(HKEY_CURRENT_USER,L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\https\\UserChoice",0,KEY_READ,&hKey) != ERROR_SUCCESS){ @@ -957,11 +956,38 @@ BROWSERTYPE getDefaultBrowserType(){ } + if(_tcscmp(browserName,TEXT("ChromeHTML")) == 0){ + rslt = BT_GOOGLE_CHROME; + + } else if(_tcscmp(browserName,TEXT("IE.HTTP")) == 0 ){ + + rslt = BT_INTERNET_EXPLORER; + + } else if(_tcscmp(browserName,TEXT("FirefoxURL"))==0){ + + rslt = BT_FIRE_FOX; + + } else if(_tcscmp(browserName,TEXT("SafariURL")) == 0){ + + rslt = BT_SAFARI; + } else if(_tcscmp(browserName,TEXT("Opera.Protocol"))==0){ + + rslt = BT_OPERA; + + } else if(_tcscmp(browserName,TEXT("Sleipnir2.HTTP"))==0){ + + rslt = BT_IE_COMPONENT; + + } else { + + rslt = BT_IE_COMPONENT; + + } - RegQueryValueEx(hKey,TEXT("Progid"),(LPDWORD)NULL,(LPDWORD)NULL,(LPBYTE)¤tUserSID,&cName); - //HKEY_CURRENT_USER\Software\Microsoft\Protected Storage System Provider\ + RegQueryValueEx(hKey,TEXT("Progid"),(LPDWORD)NULL,(LPDWORD)NULL,(LPBYTE)&browserName,&cName); + RegCloseKey(hKey);