OSDN Git Service

Bb60からマージ
[gikonavigoeson/gikonavi.git] / Giko.pas
index 838d263..aa33d7f 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -24,8 +24,7 @@ uses
 const
        NGWORDNAME_PANEL = 3;
        THREADSIZE_PANEL = 2;
-    USER_RESPOPUPCLEAR         = WM_USER + 2005;       ///< wParam : TWebBrowser
-       
+    USER_POPUPCLEAR            = WM_USER + 2005;       ///< wParam : TWebBrowser
 type
 
        TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
@@ -420,8 +419,15 @@ type
     TaskTrayPopupMenu: TPopupMenu;
     Exit1: TMenuItem;
     N83: TMenuItem;
+    UpdateGikonaviAction1: TMenuItem;
+    N84: TMenuItem;
+    N85: TMenuItem;
+    URL2: TMenuItem;
+    URLPATHINFO1: TMenuItem;
+    URLQUERYSTRING1: TMenuItem;
                                procedure FormCreate(Sender: TObject);
                procedure FormDestroy(Sender: TObject);
+        procedure SaveSettingAll();
                procedure BrowserStatusTextChange(Sender: TObject;
                        const Text: WideString);
                procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
@@ -606,6 +612,9 @@ type
                FPreviewBrowserRect: TRect;                     ///< \83v\83\8c\83r\83\85\81[\82Ì\95\\8e¦\88Ê\92u\82ð\8bL\89¯\82·\82é
                FActionListGroupIndexes: array of Integer;      ///<GikoDM\8fã\82Ì\83A\83N\83V\83\87\83\93\83\8a\83X\83g\82Ì\8ae\83A\83N\83V\83\87\83\93\82É\90Ý\92è\82³\82ê\82½GroupIndex\82ð\95Û\91\82·\82é\94z\97ñ
         FResPopupBrowser: TResPopupBrowser;
+        FUpdateExePath: string;    ///\83M\83R\83i\83r\8dX\90V\83C\83\93\83X\83g\81[\83\89\83p\83X
+        FUpdateExeArgs: string;    ///\83M\83R\83i\83r\8dX\90V\83C\83\93\83X\83g\81[\83\89\88ø\90\94
+        FKokoPopupThreadItem: TThreadItem;
                procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
                procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
                procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
@@ -694,7 +703,8 @@ type
         procedure AcceptDropFiles(var Msg: TMsg);
         //! \83X\83\8c\83b\83h\88ê\97\97\8dX\90V\8f\88\97\9d
         procedure UpdateListView();
-
+        //! \83A\83C\83R\83\93\93Ç\82Ý\8d\9e\82Ý
+        procedure LoadIcon();
        protected
                procedure CreateParams(var Params: TCreateParams); override;
                procedure WndProc(var Message: TMessage); override;
@@ -707,7 +717,7 @@ type
                BrowserNullTab: TBrowserRecord;
                FControlThread: TThreadControl;
         FIconData : TNotifyIconData;
-               procedure MoveToURL(const inURL: string);
+               procedure MoveToURL(const inURL: string; KeyMask: Boolean = False);
                function InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True) : TBrowserRecord;
                procedure ReloadBBS;
                function GetHttpState: Boolean;
@@ -732,6 +742,9 @@ type
                property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;
                property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;
                property WorkCount: Integer read FWorkCount write FWorkCount;
+        property UpdateExePath: string read FUpdateExePath write FUpdateExePath;
+        property UpdateExeArgs: string read FUpdateExeArgs write FUpdateExeArgs;
+        
                procedure SetContent(inThread: TBrowserRecord);
                function GetActiveContent(popup :Boolean = false): TThreadItem;
                function GetActiveList: TObject;
@@ -751,6 +764,9 @@ type
                property ListViewBackGroundColor: TColor read FListViewBackGroundColor write SetListViewBackGroundColor;
                property UseOddResOddColor : Boolean read FUseOddResOddColor write FUseOddResOddColor;
                property OddColor : TColor read FOddColor write FOddColor;
+        //! \83\8c\83X\83\81\83j\83\85\81[\83A\83N\83e\83B\83u\83X\83\8c\83b\83h\83A\83C\83e\83\80
+        property KokoPopupThreadItem : TThreadItem read FKokoPopupThreadItem;
+
                function FindToolBarButton( bar : TToolBar; action : TAction ) : TToolButton;
                procedure OnPlugInMenuItem( Sender : TObject );
                procedure TabFileURLReplace(oldURLs: TStringList; newURLs: TStringList);
@@ -925,6 +941,8 @@ begin
     FResPopupBrowser := nil;
        CreateBrowsers(BROWSER_COUNT);
     FIconData.uID := 0;
+    FUpdateExePath := '';
+    FUpdateExeArgs := '';
 
        //\83\81\83j\83\85\81[\83t\83H\83\93\83g
        SetMenuFont;
@@ -932,6 +950,9 @@ begin
        //\8eè\82Ì\83J\81[\83\\83\8b
        Screen.Cursors[5] := LoadCursor(HInstance, 'GIKOHAND');
 
+    // \83A\83C\83R\83\93\82Ì\93Ç\82Ý\8eæ\82è
+    LoadIcon;
+
        //\83A\83h\83\8c\83X\97\9a\97ð\93Ç\82Ý\8d\9e\82Ý
        AddressHistoryDM.ReadHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
 
@@ -1011,7 +1032,11 @@ begin
                case FResRangeMenuSelect of
                Ord( grrKoko ): GikoDM.OnlyKokoResAction.Checked        := True;
                Ord( grrNew ):  GikoDM.OnlyNewResAction.Checked := True;
-               100:                    GikoDM.OnlyAHundredResAction.Checked            := True;
+               10..65535:
+            begin
+                GikoDM.OnlyAHundredResAction.Checked           := True;
+                GikoSys.ResRange := GikoSys.Setting.ResRangeExCount;
+            end;
                end;
        end;
 
@@ -1326,8 +1351,13 @@ begin
 
     // \8f\89\8aú\89»\82É\8e¸\94s\82µ\82½\83\82\83W\83\85\81[\83\8b\83`\83F\83b\83N
     if (FavoriteDM.AbEnd) then begin
-        GikoUtil.MsgBox(Self.Handle, '\82¨\8bC\82É\93ü\82è\82Ì\8f\89\8aú\89»\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B\83M\83R\83i\83r\82ð\8fI\97¹\82µ\82Ü\82·\81B',
+        GikoUtil.MsgBox(Self.Handle,
+            '\82¨\8bC\82É\93ü\82è\82Ì\8f\89\8aú\89»\82É\8e¸\94s\82µ\82Ü\82µ\82½\81B\83M\83R\83i\83r\82ð\8fI\97¹\82µ\82Ü\82·\81B'#13#10 +
+            '\83M\83R\83i\83r\83t\83H\83\8b\83_\82ð\8aJ\82«\82Ü\82·\81Aconfig/' + Favorite.FAVORITE_FILE_NAME +
+            ' \82ð config/~' + Favorite.FAVORITE_FILE_NAME + '(\91O\89ñ\8bN\93®\8e\9e\82Ì\82¨\8bC\82É\93ü\82è)\82Å'#13#10 +
+             '\92u\82«\8a·\82¦\82é\8e\96\82Å\92¼\82é\89Â\94\\90«\82ª\82 \82è\82Ü\82·\81B',
             '\8f\89\8aú\89»\88Ù\8fí');
+        GikoDM.GikoFolderOpenAction.Execute;
         Self.Close;
     end;
 
@@ -1454,8 +1484,8 @@ var
        item        : TThreadItem;
 begin
        if FStartUp then begin
+       FStartUp := false;
                ShowWindow(Application.Handle, SW_HIDE);
-
                //FormCreate\82Å\82â\82é\82Æ\89Â\8e\8b\90Ý\92è\82ª\94½\89f\82³\82ê\82È\82¢\8fê\8d\87\82ª\82 \82é\82Ì\82ÅFormShow\82Å\82â\82é\82±\82Æ\82É\82µ\82½
                //\83c\81[\83\8b\83o\81[\95\\8e¦
                GikoDM.StdToolBarVisibleAction.Checked := GikoSys.Setting.StdToolBarVisible;
@@ -1480,31 +1510,30 @@ begin
 //             ResetBandInfo( ListCoolBar, ListToolBar );
                FIsIgnoreResize := rtNone;
 
+        //ActionList\82ÌGroupIndex\82ð\8c³\82É\96ß\82·
+               SetGroupIndex(GikoDM.GikoFormActionList);
+
                //FormCrete\82©\82ç\88Ú\93®\81B
                if GikoSys.Setting.TabAutoLoadSave then begin
             GikoDM.TabsOpenAction.Tag := 1;
                        GikoDM.TabsOpenAction.Execute;
             GikoDM.TabsOpenAction.Tag := 0;
             if (GikoSys.Setting.LastCloseTabURL <> '') then begin
-                PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( FActiveContent.Browser ), 0 );
                 if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin
                        while (FActiveContent.Browser.ReadyState <> READYSTATE_COMPLETE) and
                                (FActiveContent.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin
-                               Application.ProcessMessages;
+                        // \83\81\83b\83Z\81[\83W\82ð\8eó\82¯\8eæ\82ç\82È\82¢\82æ\82¤\82É\83X\83\8a\81[\83v\82É\95Ï\8dX
+                        Sleep(1);
                     end;
                        end;
                 item := BBSsFindThreadFromURL( GikoSys.Setting.LastCloseTabURL );
+                GikoSys.Setting.LastCloseTabURL := '';
                 if (item <> nil) and (item.IsLogFile) then begin
                     OpenThreadItem(item, item.URL);
                 end;
-                GikoSys.Setting.LastCloseTabURL := '';
+                //ShowWindow(Self.Handle, SW_SHOW);
             end;
                end;
-
-        //ActionList\82ÌGroupIndex\82ð\8c³\82É\96ß\82·
-               SetGroupIndex(GikoDM.GikoFormActionList);
-
-               FStartUp := false;
        end;
 end;
 
@@ -1544,38 +1573,25 @@ begin
 
        Application.UnhookMainWindow(Hook);
     //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8fI\97¹\82Ì\91O\82É\83_\83E\83\93\83\8d\81[\83h\83X\83\8c\83b\83h\82É\90³\8fí\8fI\97¹\82ð\91£\82·
+    FControlThread.DownloadAbort;
     FControlThread.Terminate;
+
+    //OnDestory\82¾\82Æ\8dÄ\8bN\93®\82ð\82©\82¯\82½\82Æ\82«\82È\82Ç\82É\95Û\91\82³\82ê\82È\82¢\82Ì\82ÅOnCloseQuery\82Å\90Ý\92è\95Û\91
+    SaveSettingAll();
+    
        Application.Terminate;
 end;
 
-procedure TGikoForm.FormDestroy(Sender: TObject);
+procedure TGikoForm.SaveSettingAll();
 var
-       i                               : Integer;
        wp                      : TWindowPlacement;
-       tmpBool : Boolean;
     WindowPlacement: TWindowPlacement;
 begin
-    // \83^\83X\83N\83g\83\8c\83C\82Ì\83A\83C\83R\83\93\8dí\8f\9c
-    if (FIconData.uID <> 0) then begin
-        Shell_NotifyIcon(NIM_DELETE, @FIconData);
-    end;
-
-       // \83}\83E\83X\83W\83F\83X\83`\83\83\81[\8aJ\95ú
-       try
-        if GikoSys.Setting.GestureEnabled then begin
-               MouseGesture.OnGestureStart := nil;
-                   MouseGesture.OnGestureMove := nil;
-                   MouseGesture.OnGestureEnd := nil;
-        end;
-        MouseGesture.Clear;
-               MouseGesture.UnHook;
-        MouseGesture.Free;
-       except
-       end;
        try
                ActiveListColumnSave;
        except
        end;
+
        try
         WindowPlacement.length := SizeOf(TWindowPlacement);
         GetWindowPlacement(Self.Handle, @WindowPlacement);
@@ -1608,20 +1624,11 @@ begin
                        GikoSys.Setting.ResRange := FResRangeMenuSelect;
        except
        end;
-       if WindowState <> wsNormal then
-               WindowState := wsNormal;
-       SaveCoolBarSettings;
-       try
-               GikoSys.Setting.WriteWindowSettingFile;
-               GikoSys.Setting.WriteNameMailSettingFile;
-       except
-       end;
-       // \83\8a\83A\83\8b\83^\83C\83\80\82É\95Û\91\82³\82ê\82é\82Ì\82Å\81A\82Ü\82½\81A\83E\83B\83\93\83h\83E\83T\83C\83Y\82ª CoolBar \82æ\82è
-       // \8f¬\82³\82­\82È\82Á\82Ä\82¢\82é\82Æ\82«\82É\95Û\91\82·\82é\82Æ\92l\82ª\8fã\8f\91\82«\82³\82ê\82Ä\82µ\82Ü\82¤\82Ì\82Å\82±\82±\82Å\82Í\95Û\91\82µ\82È\82¢
-
-               // \81ªFormDestroy\92\86\82É\88Ú\93®\82µ\82½\82Ì\82Å\81A\82±\82±\82Å\95Û\91\82µ\82È\82¢\82Æ\82¢\82¯\82È\82¢\82Æ\8ev\82¤\81B\81i\82à\82\82ã\81@2004/04/09\81j
-       // CoolBar \95Û\91
-       //if (GikoForm.WindowState <> wsMinimized) and (GikoForm.WindowState <> wsMaximized) then
+    //\8d¡\82Ìwinodw\82Ì\83X\83^\83C\83\8b\82ÅCoolBar\82Ì\88Ê\92u\81A\83E\83B\83\93\83h\83E\82Ì\88Ê\92u\82ð\95Û\91
+    SaveCoolBarSettings;
+    GikoSys.Setting.WriteWindowSettingFile;
+    // \96¼\91O\82Æ\83\81\81[\83\8b\82Ì\95Û\91\82È\82Ì\82Å\83G\83f\83B\83^\82ª\95Â\82\82½\8cã\82È\82ç\82¢\82Â\82Å\82à\82¢\82¢
+    GikoSys.Setting.WriteNameMailSettingFile;
 
        //\93ü\97Í\83A\83V\83X\83g\8b@\8d\\82Ì\90Ý\92è\82Ì\95Û\91
        InputAssistDM.SaveToFile(GikoSys.GetInputAssistFileName);
@@ -1633,10 +1640,71 @@ begin
         if not (FavoriteDM.AbEnd) then begin
                FavoriteDM.WriteFavorite;
         end;
+       except
+       end;
+
+       //\83A\83h\83\8c\83X\97\9a\97ð\95Û\91
+       try
+               //AddressHistoryDM\82Í\8e©\93®\90\90¬\83t\83H\81[\83\80\82È\82Ì\82Å\81A\89ð\95ú\82Í\8e©\93®\93I\82É\82³\82ê\82é\81B
+               AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
+       except
+       end;
+
+       //\83q\83X\83g\83\8a\83\8a\83X\83g\95Û\91
+       try
+               FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
+       except
+       end;
+
+       //\8f\84\89ñ\83\8a\83X\83g\95Û\91
+       try
+               RoundList.SaveRoundFile;
+       except
+       end;
+
+    // \83^\83X\83N\83g\83\8c\83C\82Ì\83A\83C\83R\83\93\8dí\8f\9c
+    if (FIconData.uID <> 0) then begin
+        Shell_NotifyIcon(NIM_DELETE, @FIconData);
+    end;
+
+end;
+
+procedure TGikoForm.FormDestroy(Sender: TObject);
+var
+       i                               : Integer;
+       tmpBool : Boolean;
+begin
+    //\88ê\8e\9e\93I\82É\92Ê\8fí\83X\83^\83C\83\8b\82É\96ß\82µ\82ÄCoolBar\82Ì\88Ê\92u\81A\83E\83B\83\93\83h\83E\82Ì\88Ê\92u\82ð\95Û\91
+    //\81¦\92\8d\88Ó\81FOnDestroy\82Å\8eg\82¤\82±\82Æ\82µ\82©\8dl\97\82³\82ê\82Ä\82¢\82È\82¢
+    //        \91¼\82Å\82â\82é\82Æ\8dÄ\95`\89æ\82ª\94­\90\82·\82é
+       if WindowState <> wsNormal then begin
+               WindowState := wsNormal;
+        try
+               SaveCoolBarSettings;
+                   GikoSys.Setting.WriteWindowSettingFile;
+       except
+           end;
+    end;
+
+       // \83}\83E\83X\83W\83F\83X\83`\83\83\81[\8aJ\95ú
+       try
+        if GikoSys.Setting.GestureEnabled then begin
+               MouseGesture.OnGestureStart := nil;
+                   MouseGesture.OnGestureMove := nil;
+                   MouseGesture.OnGestureEnd := nil;
+        end;
+        MouseGesture.Clear;
+               MouseGesture.UnHook;
+        MouseGesture.Free;
+       except
+       end;
+
+       //\82¨\8bC\82É\93ü\82è\94j\8aü
+       try
                FavoriteDM.Clear;
        except
        end;
-       //LockWindowUpdate(Self.Handle);
+
        try
                //\83^\83u\83N\83\8d\81[\83Y
                tmpBool := GikoSys.Setting.ShowDialogForAllTabClose;
@@ -1645,6 +1713,7 @@ begin
                GikoSys.Setting.ShowDialogForAllTabClose := tmpBool;
        except
        end;
+
        try
                for i := FBrowsers.Count - 1 downto 0 do begin
             GikoSys.ShowRefCount('browser' + IntToStr(i), TWebBrowser(FBrowsers[i]).ControlInterface);
@@ -1659,6 +1728,7 @@ begin
        finally
                FBrowsers.Free;
        end;
+
        try
                if BrowserNullTab <> nil then begin
                        BrowserNullTab.Browser := nil;  {*BrowserNullTab\82ÌBrowser\82Í\90Ý\8cv\8e\9e\82É\93\\82è\95t\82¯\82Ä\82é\93z
@@ -1677,18 +1747,6 @@ begin
        except
        end;
 
-       //\83A\83h\83\8c\83X\97\9a\97ð\95Û\91
-       try
-               //AddressHistoryDM\82Í\8e©\93®\90\90¬\83t\83H\81[\83\80\82È\82Ì\82Å\81A\89ð\95ú\82Í\8e©\93®\93I\82É\82³\82ê\82é\81B
-               AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount);
-       except
-       end;
-
-       //\83q\83X\83g\83\8a\83\8a\83X\83g\95Û\91
-       try
-               FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml');
-       except
-       end;
        try
                try
                        FHistoryList.Clear;
@@ -1698,11 +1756,7 @@ begin
                FHistoryList.Free;
        end;
 
-       //\8f\84\89ñ\83\8a\83X\83g\95Û\91¶&\94j\8aü
-       try
-               RoundList.SaveRoundFile;
-       except
-       end;
+
        try
                try
                        RoundList.Clear;
@@ -1714,7 +1768,7 @@ begin
 
        try
         try
-            FControlThread.DownloadAbort;
+            //FControlThread.DownloadAbort;
             FControlThread.Terminate;
             FControlThread.WaitFor;
         except
@@ -1766,7 +1820,12 @@ begin
                end;
        except
        end;
-       //LockWindowUpdate(0);
+
+    // Update\82ª\82¢\82ê\82Î\8eÀ\8ds\82·\82é
+    if FileExists(FUpdateExePath) then begin
+        // \83A\83b\83v\83f\81[\83g\8eÀ\8ds
+        GikoSys.CreateProcess(FUpdateExePath, FUpdateExeArgs);
+    end;
 end;
 
 // \8ae\8f\8a\82É\82 \82é\83L\83\83\83r\83l\83b\83g\81E BBS \83\81\83j\83\85\81[\82ð\83Z\83b\83g\81^\8dX\90V
@@ -2033,7 +2092,8 @@ begin
        s := '';
        Ext := AnsiLowerCase(ExtractFileExt(Text2));
        if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and
-                       ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin
+                       ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) or
+        (Pos('http://www.nicovideo.jp/watch/', Text2) = 1)  then begin
                if FPreviewBrowser = nil then begin
                        FPreviewBrowser := TPreviewBrowser.Create(Self);
                        ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
@@ -2320,9 +2380,10 @@ begin
 {$IFDEF DEBUG}
        Writeln(URL);
 {$ENDIF}
+    FKokoPopupThreadItem := nil;
        if Pos(kMenuName, URL) <> 0 then begin
                sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) );
-               
+
                if not GikoSys.IsNumeric(sNo) then Exit;
 
                Cancel := True;
@@ -2330,6 +2391,17 @@ begin
         KokoPopupMenu.PopupComponent := nil;
         if (Sender is TComponent) then
             KokoPopupMenu.PopupComponent := TComponent(Sender);
+        // \8cë\94\9a\91Î\8dô \83N\83\8a\83b\83N\82µ\82½\83u\83\89\83E\83U\82Æ\88Ù\82È\82é\82Æ\82«\82É\8fÁ\82·\8f\88\97\9d\82ð\92Ç\89Á
+        if not (Sender is TResPopupBrowser) then begin
+            if (FResPopupBrowser <> nil) and (FResPopupBrowser.CurrentBrowser.Visible = True) then begin
+                FResPopupBrowser.Clear;
+            end;
+        end else begin
+            if (Sender <> FResPopupBrowser.CurrentBrowser) then begin
+                TResPopupBrowser(Sender).ChildClear;
+            end;
+        end;
+        FKokoPopupThreadItem := GetActiveContent(true);
                KokoPopupMenu.Tag := StrToInt(sNo);
                KokoPopupMenu.Popup(p.x, p.y);
        end else if Pos('mailto', LowerCase(URL)) <> 0 then begin
@@ -4634,7 +4706,7 @@ begin
        end;
 end;
 
-procedure TGikoForm.MoveToURL(const inURL: string);
+procedure TGikoForm.MoveToURL(const inURL: string; KeyMask: Boolean = False);
 var
        protocol, host, path, document, port, bookmark : string;
        URL, protocol2, host2, path2, document2, port2, bookmark2 : string;
@@ -4651,17 +4723,18 @@ begin
 
        GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
        GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
-
-
-       shiftDown       := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
-       ctrlDown        := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);
-       if shiftDown then begin
-               GikoSys.OpenBrowser(inURL, gbtUserApp);
-               Exit;
-       end else if ctrlDown then begin
-               GikoSys.OpenBrowser(inURL, gbtIE);
-               Exit;
-       end;
+    // \83A\83N\83V\83\87\83\93\82©\82ç\8cÄ\82Î\82ê\82é\82Æshift/ctrl\82Í\82¨\82µ\82Á\82Ï\82Ì\8fê\8d\87\82ª\82Ù\82Æ\82ñ\82Ç\82È\82Ì\82Å\83}\83X\83N\82·\82é
+    if not KeyMask then begin
+        shiftDown      := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
+        ctrlDown       := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);
+        if shiftDown then begin
+            GikoSys.OpenBrowser(inURL, gbtUserApp);
+            Exit;
+        end else if ctrlDown then begin
+            GikoSys.OpenBrowser(inURL, gbtIE);
+            Exit;
+        end;
+    end;
 
        //===== \83v\83\89\83O\83C\83\93
        try
@@ -4860,12 +4933,16 @@ begin
                                senderBrowser := TWebBrowser( Message.WParam );
                                BrowserDocumentComplete( senderBrowser, senderBrowser.Parent, url );
                        end;
-        USER_RESPOPUPCLEAR:
+        USER_POPUPCLEAR:
             if (TObject(Message.WParam) is TResPopupBrowser) then begin
                 try
                                TResPopupBrowser( Message.WParam ).Clear;
                 except
                 end;
+                       end else if (TObject(Message.WParam) is TPreviewBrowser) then begin
+                if FPreviewBrowser <> nil then begin
+                       ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
+                end;
                        end;
                end;
 
@@ -7276,7 +7353,7 @@ var
 begin
        No := KokoPopupMenu.Tag;
        if No = 0 then Exit;
-       ThreadItem := GetActiveContent(True);
+       ThreadItem := GikoForm.KokoPopupThreadItem;
        if ThreadItem = nil then Exit;
 
     id := GikoSys.GetResID(No, ThreadItem);
@@ -7335,7 +7412,7 @@ var
 begin
        No := KokoPopupMenu.Tag;
        if No = 0 then Exit;
-       ThreadItem := GetActiveContent(True);
+       ThreadItem := GikoForm.KokoPopupThreadItem;
        if ThreadItem = nil then Exit;
        body := TStringList.Create;
        try
@@ -7951,6 +8028,53 @@ begin
         FResPopupBrowser.CurrentBrowser.ChildClear;
     end;
 end;
+//! \83A\83C\83R\83\93\93Ç\82Ý\8d\9e\82Ý
+procedure TGikoForm.LoadIcon();
+const
+    ICONI6 = 'icon16.bmp';
+    ICON32 = 'icon32.bmp';
+    ICONSTAT  = 'state_icon.bmp';
+    ICONMES = 'message_icon.bmp';
+    ICONADD = 'address_icon.bmp';
+    ICONITEM = 'item_icon.bmp';
+    ICONTOOL = 'hottoolbar_icon.bmp';
+begin
+    if FileExists(GikoSys.Setting.GetAppDir + ICONI6) then begin
+        ItemIcon16.Clear;
+        ItemIcon16.FileLoad(rtBitmap,
+            GikoSys.Setting.GetAppDir + ICONI6, clPurple);
+    end;
+    if FileExists(GikoSys.Setting.GetAppDir + ICON32) then begin
+        ItemIcon32.Clear;
+        ItemIcon32.FileLoad(rtBitmap,
+            GikoSys.Setting.GetAppDir + ICON32, clPurple);
+    end;
+    if FileExists(GikoSys.Setting.GetAppDir + ICONSTAT) then begin
+        StateIconImageList.Clear;
+        StateIconImageList.FileLoad(rtBitmap,
+            GikoSys.Setting.GetAppDir + ICONSTAT, clPurple);
+    end;
+    if FileExists(GikoSys.Setting.GetAppDir + ICONMES) then begin
+        MessageImageList.Clear;
+        MessageImageList.FileLoad(rtBitmap,
+            GikoSys.Setting.GetAppDir + ICONMES, clPurple);
+    end;
+    if FileExists(GikoSys.Setting.GetAppDir + ICONADD) then begin
+        AddressImageList.Clear;
+        AddressImageList.FileLoad(rtBitmap,
+            GikoSys.Setting.GetAppDir + ICONADD, clPurple);
+    end;
+    if FileExists(GikoSys.Setting.GetAppDir + ICONITEM) then begin
+        ItemImageList.Clear;
+        ItemImageList.FileLoad(rtBitmap,
+            GikoSys.Setting.GetAppDir + ICONITEM, clPurple);
+    end;
+    if FileExists(GikoSys.Setting.GetAppDir + ICONTOOL) then begin
+        HotToobarImageList.Clear;
+        HotToobarImageList.FileLoad(rtBitmap,
+            GikoSys.Setting.GetAppDir + ICONTOOL, clPurple);
+    end;
+end;
 
 initialization
                                OleInitialize(nil);