OSDN Git Service

Fix bugs of host list dialog.
authors_kawamoto <s_kawamoto@users.sourceforge.jp>
Wed, 12 Oct 2011 15:43:05 +0000 (00:43 +0900)
committers_kawamoto <s_kawamoto@users.sourceforge.jp>
Wed, 12 Oct 2011 15:43:05 +0000 (00:43 +0900)
FFFTP_Eng_Release/FFFTP.exe
Release/FFFTP.exe
hostman.c
mbswrapper.c

index 0db5d38..0ebca86 100644 (file)
Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ
index 7b3b8b4..e1aec99 100644 (file)
Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ
index b65c0c9..9496ddc 100644 (file)
--- a/hostman.c
+++ b/hostman.c
@@ -151,7 +151,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
        int Level2;\r
        HOSTLISTDATA *Data1;\r
        HOSTLISTDATA *Data2;\r
-       NM_TREEVIEW *tView;\r
+       // UTF-8対応\r
+//     NM_TREEVIEW *tView;\r
+       NM_TREEVIEWW *tView;\r
        HTREEITEM tViewPos;\r
        TV_HITTESTINFO HitInfo;\r
 \r
@@ -550,7 +552,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
                        break;\r
 \r
                case WM_NOTIFY:\r
-                       tView = (NM_TREEVIEW FAR *)lParam;\r
+                       // UTF-8対応\r
+//                     tView = (NM_TREEVIEW FAR *)lParam;\r
+                       tView = (NM_TREEVIEWW FAR *)lParam;\r
                        switch(tView->hdr.idFrom)\r
                        {\r
                                case HOST_LIST :\r
@@ -558,7 +562,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
                                        hItem = tView->itemNew.hItem;\r
                                        switch(tView->hdr.code)\r
                                        {\r
-                                               case TVN_SELCHANGED :\r
+                                               // UTF-8対応\r
+//                                             case TVN_SELCHANGED :\r
+                                               case TVN_SELCHANGEDW :\r
                                                        /* フォルダが選ばれたときは接続、コピーボタンは禁止 */\r
                                                        Item.hItem = hItem;\r
                                                        Item.mask = TVIF_PARAM;\r
index d65022e..f51a62d 100644 (file)
@@ -610,6 +610,10 @@ LRESULT SendMessageM(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
        LVFINDINFOW wLVFindInfo;
        LVCOLUMNA* pmLVColumn;
        LVCOLUMNW wLVColumn;
+       TVITEMEXA* pmTVItem;
+       TVITEMEXW wTVItem;
+       TVINSERTSTRUCTA* pmTVInsert;
+       TVINSERTSTRUCTW wTVInsert;
        wchar_t ClassName[MAX_PATH];
 START_ROUTINE
        switch(Msg)
@@ -887,6 +891,83 @@ START_ROUTINE
                                break;
                        }
                }
+               else if(_wcsicmp(ClassName, WC_TREEVIEWW) == 0)
+               {
+                       switch(Msg)
+                       {
+                       case TVM_GETITEMA:
+                               pmTVItem = (TVITEMEXA*)lParam;
+                               wTVItem.mask = pmTVItem->mask;
+                               wTVItem.hItem = pmTVItem->hItem;
+                               wTVItem.state = pmTVItem->state;
+                               wTVItem.stateMask = pmTVItem->stateMask;
+                               if(pmTVItem->mask & TVIF_TEXT)
+                               {
+                                       Size = pmTVItem->cchTextMax * 4;
+                                       pw0 = AllocateStringW(Size);
+                                       wTVItem.pszText = pw0;
+                                       wTVItem.cchTextMax = Size;
+                               }
+                               wTVItem.iImage = pmTVItem->iImage;
+                               wTVItem.iSelectedImage = pmTVItem->iSelectedImage;
+                               wTVItem.cChildren = pmTVItem->cChildren;
+                               wTVItem.lParam = pmTVItem->lParam;
+                               wTVItem.iIntegral = pmTVItem->iIntegral;
+//                             wTVItem.uStateEx = pmTVItem->uStateEx;
+//                             wTVItem.hwnd = pmTVItem->hwnd;
+//                             wTVItem.iExpandedImage = pmTVItem->iExpandedImage;
+//                             wTVItem.iReserved = pmTVItem->iReserved;
+                               r = SendMessageW(hWnd, TVM_GETITEMW, wParam, (LPARAM)&wTVItem);
+                               pmTVItem->mask = wTVItem.mask;
+                               pmTVItem->hItem = wTVItem.hItem;
+                               pmTVItem->state = wTVItem.state;
+                               pmTVItem->stateMask = wTVItem.stateMask;
+                               if(pmTVItem->mask & TVIF_TEXT)
+                               {
+                                       WtoM(pmTVItem->pszText, pmTVItem->cchTextMax, wTVItem.pszText, -1);
+                                       TerminateStringM(pmTVItem->pszText, pmTVItem->cchTextMax);
+                               }
+                               pmTVItem->iImage = wTVItem.iImage;
+                               pmTVItem->iSelectedImage = wTVItem.iSelectedImage;
+                               pmTVItem->cChildren = wTVItem.cChildren;
+                               pmTVItem->lParam = wTVItem.lParam;
+                               pmTVItem->iIntegral = wTVItem.iIntegral;
+//                             pmTVItem->uStateEx = wTVItem.uStateEx;
+//                             pmTVItem->hwnd = wTVItem.hwnd;
+//                             pmTVItem->iExpandedImage = wTVItem.iExpandedImage;
+//                             pmTVItem->iReserved = wTVItem.iReserved;
+                               break;
+                       case TVM_INSERTITEMA:
+                               pmTVInsert = (TVINSERTSTRUCTA*)lParam;
+                               wTVInsert.hParent = pmTVInsert->hParent;
+                               wTVInsert.hInsertAfter = pmTVInsert->hInsertAfter;
+                               wTVInsert.itemex.mask = pmTVInsert->itemex.mask;
+                               wTVInsert.itemex.hItem = pmTVInsert->itemex.hItem;
+                               wTVInsert.itemex.state = pmTVInsert->itemex.state;
+                               wTVInsert.itemex.stateMask = pmTVInsert->itemex.stateMask;
+                               if(pmTVInsert->itemex.mask & TVIF_TEXT)
+                               {
+                                       pw0 = DuplicateMtoW(pmTVInsert->itemex.pszText, -1);
+                                       wTVInsert.itemex.pszText = pw0;
+                                       // TODO: cchTextMaxの確認
+                                       wTVInsert.itemex.cchTextMax = pmTVInsert->itemex.cchTextMax;
+                               }
+                               wTVInsert.itemex.iImage = pmTVInsert->itemex.iImage;
+                               wTVInsert.itemex.iSelectedImage = pmTVInsert->itemex.iSelectedImage;
+                               wTVInsert.itemex.cChildren = pmTVInsert->itemex.cChildren;
+                               wTVInsert.itemex.lParam = pmTVInsert->itemex.lParam;
+                               wTVInsert.itemex.iIntegral = pmTVInsert->itemex.iIntegral;
+//                             wTVInsert.itemex.uStateEx = pmTVInsert->itemex.uStateEx;
+//                             wTVInsert.itemex.hwnd = pmTVInsert->itemex.hwnd;
+//                             wTVInsert.itemex.iExpandedImage = pmTVInsert->itemex.iExpandedImage;
+//                             wTVInsert.itemex.iReserved = pmTVInsert->itemex.iReserved;
+                               r = SendMessageW(hWnd, TVM_INSERTITEMW, wParam, (LPARAM)&wTVInsert);
+                               break;
+                       default:
+                               r = SendMessageW(hWnd, Msg, wParam, lParam);
+                               break;
+                       }
+               }
                else
                        r = SendMessageW(hWnd, Msg, wParam, lParam);
                break;