OSDN Git Service

Change the character code of windows into UTF-16 completely.
authors_kawamoto <s_kawamoto@users.sourceforge.jp>
Tue, 29 Nov 2011 12:54:03 +0000 (21:54 +0900)
committers_kawamoto <s_kawamoto@users.sourceforge.jp>
Tue, 29 Nov 2011 12:54:03 +0000 (21:54 +0900)
Add support for 64 bit Windows.

FFFTP_Eng_Release/FFFTP.exe
Release/FFFTP.exe
filelist.c
getput.c
hostman.c
lvtips.c
main.c
mbswrapper.c
mbswrapper.h
toolmenu.c

index 0590b8c..c3442b0 100644 (file)
Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ
index 0d96dca..5839e62 100644 (file)
Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ
index c3de027..51da350 100644 (file)
@@ -185,7 +185,9 @@ int MakeListWin(HWND hWnd, HINSTANCE hInst)
 \r
        if(hWndListLocal != NULL)\r
        {\r
-               LocalProcPtr = (WNDPROC)SetWindowLong(hWndListLocal, GWL_WNDPROC, (LONG)LocalWndProc);\r
+               // 64ビット対応\r
+//             LocalProcPtr = (WNDPROC)SetWindowLong(hWndListLocal, GWL_WNDPROC, (LONG)LocalWndProc);\r
+               LocalProcPtr = (WNDPROC)SetWindowLongPtr(hWndListLocal, GWL_WNDPROC, (LONG_PTR)LocalWndProc);\r
 \r
            Tmp = SendMessage(hWndListLocal, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);\r
            Tmp |= LVS_EX_FULLROWSELECT;\r
@@ -234,7 +236,9 @@ int MakeListWin(HWND hWnd, HINSTANCE hInst)
 \r
        if(hWndListRemote != NULL)\r
        {\r
-               RemoteProcPtr = (WNDPROC)SetWindowLong(hWndListRemote, GWL_WNDPROC, (LONG)RemoteWndProc);\r
+               // 64ビット対応\r
+//             RemoteProcPtr = (WNDPROC)SetWindowLong(hWndListRemote, GWL_WNDPROC, (LONG)RemoteWndProc);\r
+               RemoteProcPtr = (WNDPROC)SetWindowLongPtr(hWndListRemote, GWL_WNDPROC, (LONG_PTR)RemoteWndProc);\r
 \r
            Tmp = SendMessage(hWndListRemote, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);\r
            Tmp |= LVS_EX_FULLROWSELECT;\r
@@ -1123,32 +1127,50 @@ void GetListTabWidth(void)
 \r
 void SetListViewType(void)\r
 {\r
-       long lStyle;\r
+       // 64ビット対応\r
+//     long lStyle;\r
+       LONG_PTR lStyle;\r
 \r
        switch(ListType)\r
        {\r
                case LVS_LIST :\r
-                       lStyle = GetWindowLong(GetLocalHwnd(), GWL_STYLE);\r
+                       // 64ビット対応\r
+//                     lStyle = GetWindowLong(GetLocalHwnd(), GWL_STYLE);\r
+                       lStyle = GetWindowLongPtr(GetLocalHwnd(), GWL_STYLE);\r
                        lStyle &= ~(LVS_REPORT | LVS_LIST);\r
                        lStyle |= LVS_LIST;\r
-                       SetWindowLong(GetLocalHwnd(), GWL_STYLE, lStyle);\r
+                       // 64ビット対応\r
+//                     SetWindowLong(GetLocalHwnd(), GWL_STYLE, lStyle);\r
+                       SetWindowLongPtr(GetLocalHwnd(), GWL_STYLE, lStyle);\r
 \r
-                       lStyle = GetWindowLong(GetRemoteHwnd(), GWL_STYLE);\r
+                       // 64ビット対応\r
+//                     lStyle = GetWindowLong(GetRemoteHwnd(), GWL_STYLE);\r
+                       lStyle = GetWindowLongPtr(GetRemoteHwnd(), GWL_STYLE);\r
                        lStyle &= ~(LVS_REPORT | LVS_LIST);\r
                        lStyle |= LVS_LIST;\r
-                       SetWindowLong(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
+                       // 64ビット対応\r
+//                     SetWindowLong(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
+                       SetWindowLongPtr(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
                        break;\r
 \r
                default :\r
-                       lStyle = GetWindowLong(GetLocalHwnd(), GWL_STYLE);\r
+                       // 64ビット対応\r
+//                     lStyle = GetWindowLong(GetLocalHwnd(), GWL_STYLE);\r
+                       lStyle = GetWindowLongPtr(GetLocalHwnd(), GWL_STYLE);\r
                        lStyle &= ~(LVS_REPORT | LVS_LIST);\r
                        lStyle |= LVS_REPORT;\r
-                       SetWindowLong(GetLocalHwnd(), GWL_STYLE, lStyle);\r
+                       // 64ビット対応\r
+//                     SetWindowLong(GetLocalHwnd(), GWL_STYLE, lStyle);\r
+                       SetWindowLongPtr(GetLocalHwnd(), GWL_STYLE, lStyle);\r
 \r
-                       lStyle = GetWindowLong(GetRemoteHwnd(), GWL_STYLE);\r
+                       // 64ビット対応\r
+//                     lStyle = GetWindowLong(GetRemoteHwnd(), GWL_STYLE);\r
+                       lStyle = GetWindowLongPtr(GetRemoteHwnd(), GWL_STYLE);\r
                        lStyle &= ~(LVS_REPORT | LVS_LIST);\r
                        lStyle |= LVS_REPORT;\r
-                       SetWindowLong(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
+                       // 64ビット対応\r
+//                     SetWindowLong(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
+                       SetWindowLongPtr(GetRemoteHwnd(), GWL_STYLE, lStyle);\r
                        break;\r
        }\r
        return;\r
index d3ca963..1dd2bb6 100644 (file)
--- a/getput.c
+++ b/getput.c
@@ -3639,7 +3639,9 @@ static LRESULT CALLBACK TransDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM
                                        /* ここに break はない */\r
 \r
                                case IDCANCEL :\r
-                                       if(!(Pkt = (TRANSPACKET*)GetWindowLong(hDlg, GWL_USERDATA)))\r
+                                       // 64ビット対応\r
+//                                     if(!(Pkt = (TRANSPACKET*)GetWindowLong(hDlg, GWL_USERDATA)))\r
+                                       if(!(Pkt = (TRANSPACKET*)GetWindowLongPtr(hDlg, GWL_USERDATA)))\r
                                                break;\r
                                        Pkt->Abort = ABORT_USER;\r
 //                                     Canceled = YES;\r
@@ -3655,7 +3657,9 @@ static LRESULT CALLBACK TransDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM
                                        SetForegroundWindow(hDlg);\r
                                MoveToForeground = NO;\r
                                KillTimer(hDlg, TIMER_DISPLAY);\r
-                               if(!(Pkt = (TRANSPACKET*)GetWindowLong(hDlg, GWL_USERDATA)))\r
+                               // 64ビット対応\r
+//                             if(!(Pkt = (TRANSPACKET*)GetWindowLong(hDlg, GWL_USERDATA)))\r
+                               if(!(Pkt = (TRANSPACKET*)GetWindowLongPtr(hDlg, GWL_USERDATA)))\r
                                        break;\r
                                if(Canceled[Pkt->ThreadCount] == YES)\r
                                        Pkt->Abort = ABORT_USER;\r
@@ -3666,7 +3670,9 @@ static LRESULT CALLBACK TransDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM
 \r
                case WM_SET_PACKET :\r
 //                     Pkt = (TRANSPACKET *)lParam;\r
-                       SetWindowLong(hDlg, GWL_USERDATA, (LONG)lParam);\r
+                       // 64ビット対応\r
+//                     SetWindowLong(hDlg, GWL_USERDATA, (LONG)lParam);\r
+                       SetWindowLongPtr(hDlg, GWL_USERDATA, (LONG_PTR)lParam);\r
                        break;\r
        }\r
        return(FALSE);\r
index afd2e4e..e75de23 100644 (file)
--- a/hostman.c
+++ b/hostman.c
@@ -163,7 +163,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
        {\r
                case WM_INITDIALOG :\r
                        /* TreeViewでのダブルクリックをつかまえるため */\r
-                       HostListProcPtr = (WNDPROC)SetWindowLong(GetDlgItem(hDlg, HOST_LIST), GWL_WNDPROC, (LONG)HostListWndProc);\r
+                       // 64ビット対応\r
+//                     HostListProcPtr = (WNDPROC)SetWindowLong(GetDlgItem(hDlg, HOST_LIST), GWL_WNDPROC, (LONG)HostListWndProc);\r
+                       HostListProcPtr = (WNDPROC)SetWindowLongPtr(GetDlgItem(hDlg, HOST_LIST), GWL_WNDPROC, (LONG_PTR)HostListWndProc);\r
 \r
 \r
 //             SetClassLong(hDlg, GCL_HICON, (LONG)LoadIcon(GetFtpInst(), MAKEINTRESOURCE(ffftp)));\r
@@ -1669,7 +1671,9 @@ static int DispHostSetDlg(HWND hDlg)
 \r
 static BOOL CALLBACK MainSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
-       long wStyle;\r
+       // 64ビット対応\r
+//     long wStyle;\r
+       LONG_PTR wStyle;\r
        char Tmp[FMAX_PATH+1];\r
        NMHDR *pnmhdr;\r
 \r
@@ -1747,17 +1751,25 @@ static BOOL CALLBACK MainSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                                        if(SendDlgItemMessage(hDlg, HSET_ANONYMOUS, BM_GETCHECK, 0, 0) == 1)\r
                                        {\r
                                                SendDlgItemMessage(hDlg, HSET_USER, WM_SETTEXT, 0, (LPARAM)"anonymous");\r
-                                               wStyle = GetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
+                                               // 64ビット対応\r
+//                                             wStyle = GetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
+                                               wStyle = GetWindowLongPtr(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
                                                wStyle &= ~ES_PASSWORD;\r
-                                               SetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
+                                               // 64ビット対応\r
+//                                             SetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
+                                               SetWindowLongPtr(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
                                                SendDlgItemMessage(hDlg, HSET_PASS, WM_SETTEXT, 0, (LPARAM)UserMailAdrs);\r
                                        }\r
                                        else\r
                                        {\r
                                                SendDlgItemMessage(hDlg, HSET_USER, WM_SETTEXT, 0, (LPARAM)"");\r
-                                               wStyle = GetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
+                                               // 64ビット対応\r
+//                                             wStyle = GetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
+                                               wStyle = GetWindowLongPtr(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
                                                wStyle |= ES_PASSWORD;\r
-                                               SetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
+                                               // 64ビット対応\r
+//                                             SetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
+                                               SetWindowLongPtr(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
                                                SendDlgItemMessage(hDlg, HSET_PASS, WM_SETTEXT, 0, (LPARAM)"");\r
                                        }\r
                                        break;\r
index 6ea8524..dcda9fb 100644 (file)
--- a/lvtips.c
+++ b/lvtips.c
@@ -299,7 +299,9 @@ static int CellRectFromPoint(HWND hWnd, POINT point, RECT *cellrect, int *col)
        int Ret;\r
 \r
        Ret = -1;\r
-       if((GetWindowLong(hWnd, GWL_STYLE) & LVS_TYPEMASK) == LVS_REPORT )\r
+       // 64ビット対応\r
+//     if((GetWindowLong(hWnd, GWL_STYLE) & LVS_TYPEMASK) == LVS_REPORT )\r
+       if((GetWindowLongPtr(hWnd, GWL_STYLE) & LVS_TYPEMASK) == LVS_REPORT )\r
        {\r
                row = ListView_GetTopIndex(hWnd);\r
                bottom = row + ListView_GetCountPerPage(hWnd);\r
diff --git a/main.c b/main.c
index e14bf0e..3b7df5b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -632,13 +632,7 @@ static int MakeAllWindows(int cmdShow)
                WinPosX = CW_USEDEFAULT;\r
                WinPosY = 0;\r
        }\r
-       // UTF-8対応\r
-       // ユーザー定義のクラスはデフォルトのWNDPROCがShift_JIS専用のため\r
-//     hWndFtp = CreateWindow(FtpClassStr, "FFFTP",\r
-//                             WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,\r
-//                             WinPosX, WinPosY, WinWidth, WinHeight,\r
-//                             HWND_DESKTOP, 0, hInstFtp, NULL);\r
-       hWndFtp = CreateWindowA(FtpClassStr, "FFFTP",\r
+       hWndFtp = CreateWindow(FtpClassStr, "FFFTP",\r
                                WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,\r
                                WinPosX, WinPosY, WinWidth, WinHeight,\r
                                HWND_DESKTOP, 0, hInstFtp, NULL);\r
@@ -845,6 +839,8 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
 {\r
        PAINTSTRUCT ps;\r
        LPTOOLTIPTEXT lpttt;\r
+       // UTF-8対応\r
+       LPTOOLTIPTEXTW wlpttt;\r
        RECT Rect;\r
 \r
        int TmpTransType;\r
@@ -1410,8 +1406,13 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                        switch(((LPNMHDR)lParam)->code)\r
                        {\r
                                /* ツールチップコントロールメッセージの処理 */\r
-                               case TTN_NEEDTEXT:\r
+                               // UTF-8対応\r
+//                             case TTN_NEEDTEXT:\r
+                               case TTN_NEEDTEXTW:\r
                                        lpttt = (LPTOOLTIPTEXT)lParam;\r
+                                       // UTF-8対応\r
+                                       // lptttは単なる警告回避用\r
+                                       wlpttt = (LPTOOLTIPTEXTW)lParam;\r
                                        lpttt->hinst = hInstFtp;\r
                                        switch(lpttt->hdr.idFrom)\r
                                        {\r
@@ -1541,15 +1542,14 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                                        lpttt->lpszText = MSGJPN176;\r
                                                        break;\r
                                        }\r
-                                       // UTF-8からShift_JISへ変換\r
+                                       // UTF-8対応\r
+                                       // UTF-8からUTF-16 LEへ変換\r
                                        {\r
                                                static wchar_t StringBufferUTF16[1024];\r
-                                               static char StringBufferSJIS[1024];\r
                                                if(lpttt->lpszText)\r
                                                {\r
                                                        MtoW(StringBufferUTF16, sizeof(StringBufferUTF16)/ sizeof(wchar_t), lpttt->lpszText, -1);\r
-                                                       WtoA(StringBufferSJIS, sizeof(StringBufferSJIS)/ sizeof(char), StringBufferUTF16, -1);\r
-                                                       lpttt->lpszText = StringBufferSJIS;\r
+                                                       wlpttt->lpszText = StringBufferUTF16;\r
                                                }\r
                                        }\r
                                        break;\r
index 72d8966..62b2112 100644 (file)
@@ -723,7 +723,7 @@ END_ROUTINE
 \r
 LONG GetWindowLongM(HWND hWnd, int nIndex)\r
 {\r
-       LRESULT r = 0;\r
+       LONG r = 0;\r
 START_ROUTINE\r
        // WNDPROCがShift_JIS用であるため\r
        if(IsWindowUnicode(hWnd))\r
@@ -736,7 +736,7 @@ END_ROUTINE
 \r
 LONG SetWindowLongM(HWND hWnd, int nIndex, LONG dwNewLong)\r
 {\r
-       LRESULT r = 0;\r
+       LONG r = 0;\r
 START_ROUTINE\r
        // WNDPROCがShift_JIS用であるため\r
        if(IsWindowUnicode(hWnd))\r
@@ -747,6 +747,32 @@ END_ROUTINE
        return r;\r
 }\r
 \r
+LONG_PTR GetWindowLongPtrM(HWND hWnd, int nIndex)\r
+{\r
+       LONG_PTR r = 0;\r
+START_ROUTINE\r
+       // WNDPROCがShift_JIS用であるため\r
+       if(IsWindowUnicode(hWnd))\r
+               r = GetWindowLongPtrW(hWnd, nIndex);\r
+       else\r
+               r = GetWindowLongPtrA(hWnd, nIndex);\r
+END_ROUTINE\r
+       return r;\r
+}\r
+\r
+LONG_PTR SetWindowLongPtrM(HWND hWnd, int nIndex, LONG_PTR dwNewLong)\r
+{\r
+       LONG_PTR r = 0;\r
+START_ROUTINE\r
+       // WNDPROCがShift_JIS用であるため\r
+       if(IsWindowUnicode(hWnd))\r
+               r = SetWindowLongPtrW(hWnd, nIndex, dwNewLong);\r
+       else\r
+               r = SetWindowLongPtrA(hWnd, nIndex, dwNewLong);\r
+END_ROUTINE\r
+       return r;\r
+}\r
+\r
 LRESULT DefWindowProcM(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)\r
 {\r
        LRESULT r = 0;\r
index d638227..f081832 100644 (file)
@@ -44,6 +44,12 @@ LONG GetWindowLongM(HWND hWnd, int nIndex);
 #undef SetWindowLong\r
 #define SetWindowLong SetWindowLongM\r
 LONG SetWindowLongM(HWND hWnd, int nIndex, LONG dwNewLong);\r
+#undef GetWindowLongPtr\r
+#define GetWindowLongPtr GetWindowLongPtrM\r
+LONG_PTR GetWindowLongPtrM(HWND hWnd, int nIndex);\r
+#undef SetWindowLongPtr\r
+#define SetWindowLongPtr SetWindowLongPtrM\r
+LONG_PTR SetWindowLongPtrM(HWND hWnd, int nIndex, LONG_PTR dwNewLong);\r
 #undef DefWindowProc\r
 #define DefWindowProc DefWindowProcM\r
 LRESULT DefWindowProcM(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);\r
index 4753add..b323e1b 100644 (file)
@@ -252,7 +252,9 @@ int MakeToolBarWindow(HWND hWnd, HINSTANCE hInst)
        if(hWndTbarMain != NULL)\r
        {\r
                /* 2007/09/21 sunasunamix  ここから *********************/\r
-               pOldTbarMainProc = (WNDPROC)SetWindowLong(hWndTbarMain, GWL_WNDPROC, (DWORD)CountermeasureTbarMainProc);\r
+               // 64ビット対応\r
+//             pOldTbarMainProc = (WNDPROC)SetWindowLong(hWndTbarMain, GWL_WNDPROC, (DWORD)CountermeasureTbarMainProc);\r
+               pOldTbarMainProc = (WNDPROC)SetWindowLongPtr(hWndTbarMain, GWL_WNDPROC, (LONG_PTR)CountermeasureTbarMainProc);\r
                /********************************************* ここまで */\r
 \r
                GetClientRect(hWnd, &Rect1);\r
@@ -277,7 +279,9 @@ int MakeToolBarWindow(HWND hWnd, HINSTANCE hInst)
        if(hWndTbarLocal != NULL)\r
        {\r
                /* 2007/09/21 sunasunamix  ここから *********************/\r
-               pOldTbarLocalProc = (WNDPROC)SetWindowLong(hWndTbarLocal, GWL_WNDPROC, (DWORD)CountermeasureTbarLocalProc);\r
+               // 64ビット対応\r
+//             pOldTbarLocalProc = (WNDPROC)SetWindowLong(hWndTbarLocal, GWL_WNDPROC, (DWORD)CountermeasureTbarLocalProc);\r
+               pOldTbarLocalProc = (WNDPROC)SetWindowLongPtr(hWndTbarLocal, GWL_WNDPROC, (LONG_PTR)CountermeasureTbarLocalProc);\r
                /********************************************* ここまで */\r
 \r
                MoveWindow(hWndTbarLocal, 0, TOOLWIN_HEIGHT, LocalWidth, TOOLWIN_HEIGHT, FALSE);\r
@@ -302,7 +306,9 @@ int MakeToolBarWindow(HWND hWnd, HINSTANCE hInst)
                        /* エディットコントロールを探す */\r
                        hWndDirLocalEdit = GetWindow(hWndDirLocal, GW_CHILD);\r
                        if(hWndDirLocalEdit != NULL)\r
-                               HistEditBoxProcPtr = (WNDPROC)SetWindowLong(hWndDirLocalEdit, GWL_WNDPROC, (LONG)HistEditBoxWndProc);\r
+                               // 64ビット対応\r
+//                             HistEditBoxProcPtr = (WNDPROC)SetWindowLong(hWndDirLocalEdit, GWL_WNDPROC, (LONG)HistEditBoxWndProc);\r
+                               HistEditBoxProcPtr = (WNDPROC)SetWindowLongPtr(hWndDirLocalEdit, GWL_WNDPROC, (LONG_PTR)HistEditBoxWndProc);\r
 \r
                        SendMessage(hWndDirLocal, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE, 0));\r
                        SendMessage(hWndDirLocal, CB_LIMITTEXT, FMAX_PATH, 0);\r
@@ -340,7 +346,9 @@ int MakeToolBarWindow(HWND hWnd, HINSTANCE hInst)
        if(hWndTbarRemote != NULL)\r
        {\r
                /* 2007/09/21 sunasunamix  ここから *********************/\r
-               pOldTbarRemoteProc = (WNDPROC)SetWindowLong(hWndTbarRemote, GWL_WNDPROC, (DWORD)CountermeasureTbarRemoteProc);\r
+               // 64ビット対応\r
+//             pOldTbarRemoteProc = (WNDPROC)SetWindowLong(hWndTbarRemote, GWL_WNDPROC, (DWORD)CountermeasureTbarRemoteProc);\r
+               pOldTbarRemoteProc = (WNDPROC)SetWindowLongPtr(hWndTbarRemote, GWL_WNDPROC, (LONG_PTR)CountermeasureTbarRemoteProc);\r
                /********************************************* ここまで */\r
 \r
                MoveWindow(hWndTbarRemote, LocalWidth + SepaWidth, TOOLWIN_HEIGHT, RemoteWidth, TOOLWIN_HEIGHT, FALSE);\r
@@ -359,7 +367,9 @@ int MakeToolBarWindow(HWND hWnd, HINSTANCE hInst)
                        /* エディットコントロールを探す */\r
                        hWndDirRemoteEdit = GetWindow(hWndDirRemote, GW_CHILD);\r
                        if(hWndDirRemoteEdit != NULL)\r
-                               HistEditBoxProcPtr = (WNDPROC)SetWindowLong(hWndDirRemoteEdit, GWL_WNDPROC, (LONG)HistEditBoxWndProc);\r
+                               // 64ビット対応\r
+//                             HistEditBoxProcPtr = (WNDPROC)SetWindowLong(hWndDirRemoteEdit, GWL_WNDPROC, (LONG)HistEditBoxWndProc);\r
+                               HistEditBoxProcPtr = (WNDPROC)SetWindowLongPtr(hWndDirRemoteEdit, GWL_WNDPROC, (LONG_PTR)HistEditBoxWndProc);\r
 \r
                        SendMessage(hWndDirRemote, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE, 0));\r
                        SendMessage(hWndDirRemote, CB_LIMITTEXT, FMAX_PATH, 0);\r
@@ -1899,7 +1909,9 @@ static LRESULT CALLBACK CountermeasureTbarMainProc(HWND hWnd,UINT uMessage,WPARA
 {\r
        switch (uMessage) {\r
        case WM_DESTROY :\r
-               SetWindowLong(hWnd,GWL_WNDPROC,(DWORD)pOldTbarMainProc);\r
+               // 64ビット対応\r
+//             SetWindowLong(hWnd,GWL_WNDPROC,(DWORD)pOldTbarMainProc);\r
+               SetWindowLongPtr(hWnd,GWL_WNDPROC,(LONG_PTR)pOldTbarMainProc);\r
                break;\r
        case WM_RBUTTONDBLCLK :\r
        case WM_RBUTTONDOWN :\r
@@ -1916,7 +1928,9 @@ static LRESULT CALLBACK CountermeasureTbarLocalProc(HWND hWnd,UINT uMessage,WPAR
 {\r
        switch (uMessage) {\r
        case WM_DESTROY :\r
-               SetWindowLong(hWnd,GWL_WNDPROC,(DWORD)pOldTbarLocalProc);\r
+               // 64ビット対応\r
+//             SetWindowLong(hWnd,GWL_WNDPROC,(DWORD)pOldTbarLocalProc);\r
+               SetWindowLongPtr(hWnd,GWL_WNDPROC,(LONG_PTR)pOldTbarLocalProc);\r
                break;\r
        case WM_RBUTTONDBLCLK :\r
        case WM_RBUTTONDOWN :\r
@@ -1933,7 +1947,9 @@ static LRESULT CALLBACK CountermeasureTbarRemoteProc(HWND hWnd,UINT uMessage,WPA
 {\r
        switch (uMessage) {\r
        case WM_DESTROY :\r
-               SetWindowLong(hWnd,GWL_WNDPROC,(DWORD)pOldTbarRemoteProc);\r
+               // 64ビット対応\r
+//             SetWindowLong(hWnd,GWL_WNDPROC,(DWORD)pOldTbarRemoteProc);\r
+               SetWindowLongPtr(hWnd,GWL_WNDPROC,(LONG_PTR)pOldTbarRemoteProc);\r
                break;\r
        case WM_RBUTTONDBLCLK :\r
        case WM_RBUTTONDOWN :\r