OSDN Git Service

規定のブラウザとのクッキー共有機能実装
authorqwerty2501 <riot313@gmail.com>
Sat, 25 Feb 2012 09:27:00 +0000 (18:27 +0900)
committerqwerty2501 <riot313@gmail.com>
Sat, 25 Feb 2012 09:27:00 +0000 (18:27 +0900)
nlite.suo
nlite/nlite_property.cpp
nlite/nlite_propertyWindow.cpp
shareCookie/shareCookie.c

index 6f5dc72..d5f488b 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index 092e06f..83cb135 100644 (file)
@@ -95,7 +95,7 @@ namespace nlite{
                numberNameFlag(FALSE),
                autoColorRegisterFlag(FALSE),
                activeCountTimeFlag(TRUE),
-               browserType(BT_INTERNET_EXPLORER),
+               browserType(BT_DEFAULT),
                ncvUserSettingReadedFlag(FALSE)
        {}
 
index ad46f74..7348706 100644 (file)
@@ -51,6 +51,7 @@ BOOL CCookieSettingWindow::OnInitDialog(CWindow wndFocus, LPARAM lInitParam){
        case BT_DEFAULT:
 
                radio = GetDlgItem(IDC_DEFAULT_BT_RADIO);
+               break;
 
        default:
                goto skip;
index 2a77b4d..6525cd6 100644 (file)
@@ -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;
        //\83\8c\83W\83X\83g\83\8a\83L\81[\82ð\93Ç\82Ý\8eæ\82è\90ê\97p\82Å\83I\81[\83v\83\93
        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)&currentUserSID,&cName);
-       //HKEY_CURRENT_USER\Software\Microsoft\Protected Storage System Provider\
+       RegQueryValueEx(hKey,TEXT("Progid"),(LPDWORD)NULL,(LPDWORD)NULL,(LPBYTE)&browserName,&cName);
+
 
 
        RegCloseKey(hKey);