FFFTPのソースコードです。
Revisão | dc9efb9a37f8901f0b3acc84a4036fe885bea33b (tree) |
---|---|
Hora | 2011-10-13 00:43:05 |
Autor | s_kawamoto <s_kawamoto@user...> |
Commiter | s_kawamoto |
Fix bugs of host list dialog.
@@ -151,7 +151,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR | ||
151 | 151 | int Level2; |
152 | 152 | HOSTLISTDATA *Data1; |
153 | 153 | HOSTLISTDATA *Data2; |
154 | - NM_TREEVIEW *tView; | |
154 | + // UTF-8対応 | |
155 | +// NM_TREEVIEW *tView; | |
156 | + NM_TREEVIEWW *tView; | |
155 | 157 | HTREEITEM tViewPos; |
156 | 158 | TV_HITTESTINFO HitInfo; |
157 | 159 |
@@ -550,7 +552,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR | ||
550 | 552 | break; |
551 | 553 | |
552 | 554 | case WM_NOTIFY: |
553 | - tView = (NM_TREEVIEW FAR *)lParam; | |
555 | + // UTF-8対応 | |
556 | +// tView = (NM_TREEVIEW FAR *)lParam; | |
557 | + tView = (NM_TREEVIEWW FAR *)lParam; | |
554 | 558 | switch(tView->hdr.idFrom) |
555 | 559 | { |
556 | 560 | case HOST_LIST : |
@@ -558,7 +562,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR | ||
558 | 562 | hItem = tView->itemNew.hItem; |
559 | 563 | switch(tView->hdr.code) |
560 | 564 | { |
561 | - case TVN_SELCHANGED : | |
565 | + // UTF-8対応 | |
566 | +// case TVN_SELCHANGED : | |
567 | + case TVN_SELCHANGEDW : | |
562 | 568 | /* フォルダが選ばれたときは接続、コピーボタンは禁止 */ |
563 | 569 | Item.hItem = hItem; |
564 | 570 | Item.mask = TVIF_PARAM; |
@@ -610,6 +610,10 @@ LRESULT SendMessageM(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) | ||
610 | 610 | LVFINDINFOW wLVFindInfo; |
611 | 611 | LVCOLUMNA* pmLVColumn; |
612 | 612 | LVCOLUMNW wLVColumn; |
613 | + TVITEMEXA* pmTVItem; | |
614 | + TVITEMEXW wTVItem; | |
615 | + TVINSERTSTRUCTA* pmTVInsert; | |
616 | + TVINSERTSTRUCTW wTVInsert; | |
613 | 617 | wchar_t ClassName[MAX_PATH]; |
614 | 618 | START_ROUTINE |
615 | 619 | switch(Msg) |
@@ -887,6 +891,83 @@ START_ROUTINE | ||
887 | 891 | break; |
888 | 892 | } |
889 | 893 | } |
894 | + else if(_wcsicmp(ClassName, WC_TREEVIEWW) == 0) | |
895 | + { | |
896 | + switch(Msg) | |
897 | + { | |
898 | + case TVM_GETITEMA: | |
899 | + pmTVItem = (TVITEMEXA*)lParam; | |
900 | + wTVItem.mask = pmTVItem->mask; | |
901 | + wTVItem.hItem = pmTVItem->hItem; | |
902 | + wTVItem.state = pmTVItem->state; | |
903 | + wTVItem.stateMask = pmTVItem->stateMask; | |
904 | + if(pmTVItem->mask & TVIF_TEXT) | |
905 | + { | |
906 | + Size = pmTVItem->cchTextMax * 4; | |
907 | + pw0 = AllocateStringW(Size); | |
908 | + wTVItem.pszText = pw0; | |
909 | + wTVItem.cchTextMax = Size; | |
910 | + } | |
911 | + wTVItem.iImage = pmTVItem->iImage; | |
912 | + wTVItem.iSelectedImage = pmTVItem->iSelectedImage; | |
913 | + wTVItem.cChildren = pmTVItem->cChildren; | |
914 | + wTVItem.lParam = pmTVItem->lParam; | |
915 | + wTVItem.iIntegral = pmTVItem->iIntegral; | |
916 | +// wTVItem.uStateEx = pmTVItem->uStateEx; | |
917 | +// wTVItem.hwnd = pmTVItem->hwnd; | |
918 | +// wTVItem.iExpandedImage = pmTVItem->iExpandedImage; | |
919 | +// wTVItem.iReserved = pmTVItem->iReserved; | |
920 | + r = SendMessageW(hWnd, TVM_GETITEMW, wParam, (LPARAM)&wTVItem); | |
921 | + pmTVItem->mask = wTVItem.mask; | |
922 | + pmTVItem->hItem = wTVItem.hItem; | |
923 | + pmTVItem->state = wTVItem.state; | |
924 | + pmTVItem->stateMask = wTVItem.stateMask; | |
925 | + if(pmTVItem->mask & TVIF_TEXT) | |
926 | + { | |
927 | + WtoM(pmTVItem->pszText, pmTVItem->cchTextMax, wTVItem.pszText, -1); | |
928 | + TerminateStringM(pmTVItem->pszText, pmTVItem->cchTextMax); | |
929 | + } | |
930 | + pmTVItem->iImage = wTVItem.iImage; | |
931 | + pmTVItem->iSelectedImage = wTVItem.iSelectedImage; | |
932 | + pmTVItem->cChildren = wTVItem.cChildren; | |
933 | + pmTVItem->lParam = wTVItem.lParam; | |
934 | + pmTVItem->iIntegral = wTVItem.iIntegral; | |
935 | +// pmTVItem->uStateEx = wTVItem.uStateEx; | |
936 | +// pmTVItem->hwnd = wTVItem.hwnd; | |
937 | +// pmTVItem->iExpandedImage = wTVItem.iExpandedImage; | |
938 | +// pmTVItem->iReserved = wTVItem.iReserved; | |
939 | + break; | |
940 | + case TVM_INSERTITEMA: | |
941 | + pmTVInsert = (TVINSERTSTRUCTA*)lParam; | |
942 | + wTVInsert.hParent = pmTVInsert->hParent; | |
943 | + wTVInsert.hInsertAfter = pmTVInsert->hInsertAfter; | |
944 | + wTVInsert.itemex.mask = pmTVInsert->itemex.mask; | |
945 | + wTVInsert.itemex.hItem = pmTVInsert->itemex.hItem; | |
946 | + wTVInsert.itemex.state = pmTVInsert->itemex.state; | |
947 | + wTVInsert.itemex.stateMask = pmTVInsert->itemex.stateMask; | |
948 | + if(pmTVInsert->itemex.mask & TVIF_TEXT) | |
949 | + { | |
950 | + pw0 = DuplicateMtoW(pmTVInsert->itemex.pszText, -1); | |
951 | + wTVInsert.itemex.pszText = pw0; | |
952 | + // TODO: cchTextMaxの確認 | |
953 | + wTVInsert.itemex.cchTextMax = pmTVInsert->itemex.cchTextMax; | |
954 | + } | |
955 | + wTVInsert.itemex.iImage = pmTVInsert->itemex.iImage; | |
956 | + wTVInsert.itemex.iSelectedImage = pmTVInsert->itemex.iSelectedImage; | |
957 | + wTVInsert.itemex.cChildren = pmTVInsert->itemex.cChildren; | |
958 | + wTVInsert.itemex.lParam = pmTVInsert->itemex.lParam; | |
959 | + wTVInsert.itemex.iIntegral = pmTVInsert->itemex.iIntegral; | |
960 | +// wTVInsert.itemex.uStateEx = pmTVInsert->itemex.uStateEx; | |
961 | +// wTVInsert.itemex.hwnd = pmTVInsert->itemex.hwnd; | |
962 | +// wTVInsert.itemex.iExpandedImage = pmTVInsert->itemex.iExpandedImage; | |
963 | +// wTVInsert.itemex.iReserved = pmTVInsert->itemex.iReserved; | |
964 | + r = SendMessageW(hWnd, TVM_INSERTITEMW, wParam, (LPARAM)&wTVInsert); | |
965 | + break; | |
966 | + default: | |
967 | + r = SendMessageW(hWnd, Msg, wParam, lParam); | |
968 | + break; | |
969 | + } | |
970 | + } | |
890 | 971 | else |
891 | 972 | r = SendMessageW(hWnd, Msg, wParam, lParam); |
892 | 973 | break; |