OSDN Git Service

Change behavior of automatic IPv4/IPv6 selection.
[ffftp/ffftp.git] / filelist.c
index cb1295b..b3e1da2 100644 (file)
@@ -147,6 +147,8 @@ static WNDPROC LocalProcPtr;
 static WNDPROC RemoteProcPtr;\r
 \r
 static HIMAGELIST ListImg = NULL;\r
+// ファイルアイコン表示対応\r
+static HIMAGELIST ListImgFileIcon = NULL;\r
 \r
 static char FindStr[40+1] = { "*" };           /* 検索文字列 */\r
 static int IgnoreNew = NO;\r
@@ -796,7 +798,7 @@ static LRESULT FileListCommonWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
                        if(hWnd == hWndListRemote)\r
                        {\r
                                if(AskConnecting() == YES)\r
-                                       UpLoadDragProc(wParam);\r
+                                       UploadDragProc(wParam);\r
                        }\r
                        else if(hWnd == hWndListLocal)\r
                        {\r
@@ -1340,22 +1342,22 @@ void RefreshIconImageList(FLISTANCHOR *Anchor)
        int i;\r
        char Cur[FMAX_PATH+1];\r
        SHFILEINFO FileInfo;\r
-       SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)NULL);\r
-       ShowWindow(hWndListLocal, SW_SHOW);\r
-       SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)NULL);\r
-       ShowWindow(hWndListRemote, SW_SHOW);\r
-       ImageList_Destroy(ListImg);\r
-       ListImg = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR24, 0, 1);\r
-       hBitmap = LoadBitmap(GetFtpInst(), MAKEINTRESOURCE(dirattr_bmp));\r
-       ImageList_AddMasked(ListImg, hBitmap, RGB(255,0,0));\r
-       DeleteObject(hBitmap);\r
-       ImageId = 0;\r
-       Pos = Anchor->Top;\r
-       for(i = 0; i < Anchor->Files; i++)\r
+       if(AskDispFileIcon() == YES)\r
        {\r
-               Pos->ImageId = -1;\r
-               if(AskDispFileIcon() == YES)\r
+               SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)NULL);\r
+               ShowWindow(hWndListLocal, SW_SHOW);\r
+               SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)NULL);\r
+               ShowWindow(hWndListRemote, SW_SHOW);\r
+               ImageList_Destroy(ListImgFileIcon);\r
+               ListImgFileIcon = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 0, 1);\r
+               hBitmap = LoadBitmap(GetFtpInst(), MAKEINTRESOURCE(dirattr16_bmp));\r
+               ImageList_AddMasked(ListImgFileIcon, hBitmap, RGB(255, 0, 0));\r
+               DeleteObject(hBitmap);\r
+               ImageId = 0;\r
+               Pos = Anchor->Top;\r
+               for(i = 0; i < Anchor->Files; i++)\r
                {\r
+                       Pos->ImageId = -1;\r
                        if(Pos->Node == NODE_DRIVE)\r
                                strcpy(Cur, Pos->File);\r
                        else\r
@@ -1366,20 +1368,27 @@ void RefreshIconImageList(FLISTANCHOR *Anchor)
                        }\r
                        if(SHGetFileInfoM(Cur, 0, &FileInfo, sizeof(SHFILEINFO), SHGFI_SMALLICON | SHGFI_ICON) != 0)\r
                        {\r
-                               if(ImageList_AddIcon(ListImg, FileInfo.hIcon) >= 0)\r
+                               if(ImageList_AddIcon(ListImgFileIcon, FileInfo.hIcon) >= 0)\r
                                {\r
                                        Pos->ImageId = ImageId;\r
                                        ImageId++;\r
                                }\r
                                DestroyIcon(FileInfo.hIcon);\r
                        }\r
+                       Pos = Pos->Next;\r
                }\r
-               Pos = Pos->Next;\r
+               SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImgFileIcon);\r
+               ShowWindow(hWndListLocal, SW_SHOW);\r
+               SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImgFileIcon);\r
+               ShowWindow(hWndListRemote, SW_SHOW);\r
+       }\r
+       else\r
+       {\r
+               SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImg);\r
+               ShowWindow(hWndListLocal, SW_SHOW);\r
+               SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImg);\r
+               ShowWindow(hWndListRemote, SW_SHOW);\r
        }\r
-       SendMessage(hWndListLocal, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImg);\r
-       ShowWindow(hWndListLocal, SW_SHOW);\r
-       SendMessage(hWndListRemote, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM)ListImg);\r
-       ShowWindow(hWndListRemote, SW_SHOW);\r
 }\r
 \r
 void GetLocalDirForWnd(void)\r
@@ -1434,7 +1443,7 @@ void GetLocalDirForWnd(void)
        if(DispDrives)\r
        {\r
                GetLogicalDriveStrings(FMAX_PATH, Scan);\r
-               NoDrives = LoadHideDriveListRegistory();\r
+               NoDrives = LoadHideDriveListRegistry();\r
 \r
                Pos = Scan;\r
                while(*Pos != NUL)\r
@@ -1695,8 +1704,8 @@ static void AddListView(HWND hWnd, int Pos, char *Name, int Type, LONGLONG Size,
        else\r
                LvItem.iImage = 4;\r
        // ファイルアイコン表示対応\r
-       if(hWnd == GetLocalHwnd() && ImageId >= 0)\r
-               LvItem.iImage = 5 + ImageId;\r
+       if(AskDispFileIcon() == YES && hWnd == GetLocalHwnd())\r
+               LvItem.iImage = ImageId + 5;\r
        LvItem.iItem = SendMessage(hWnd, LVM_INSERTITEM, 0, (LPARAM)&LvItem);\r
 \r
        /* 日付/時刻 */\r
@@ -4911,6 +4920,7 @@ static int ResolvFileInfo(char *Str, int ListType, char *Fname, LONGLONG *Size,
                                                        sTime.wSecond = atoi_n(Value + 12, 2);\r
                                                        sTime.wMilliseconds = 0;\r
                                                        SystemTimeToFileTime(&sTime, Time);\r
+                                                       // 時刻はGMT\r
 //                                                     SpecificLocalFileTime2FileTime(Time, AskHostTimeZone());\r
                                                        *InfoExist |= FINFO_DATE | FINFO_TIME;\r
                                                }\r