OSDN Git Service

Add UTF-8 to UTF-16 API bridge.
[ffftp/ffftp.git] / toolmenu.c
1 /*=============================================================================\r
2 *\r
3 *                                                               \83c\81[\83\8b\83o\81[\82Æ\83\81\83j\83\85\81[\r
4 *\r
5 ===============================================================================\r
6 / Copyright (C) 1997-2007 Sota. All rights reserved.\r
7 /\r
8 / Redistribution and use in source and binary forms, with or without \r
9 / modification, are permitted provided that the following conditions \r
10 / are met:\r
11 /\r
12 /  1. Redistributions of source code must retain the above copyright \r
13 /     notice, this list of conditions and the following disclaimer.\r
14 /  2. Redistributions in binary form must reproduce the above copyright \r
15 /     notice, this list of conditions and the following disclaimer in the \r
16 /     documentation and/or other materials provided with the distribution.\r
17 /\r
18 / THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR \r
19 / IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES \r
20 / OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \r
21 / IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, \r
22 / INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \r
23 / BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF \r
24 / USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON \r
25 / ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
26 / (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF \r
27 / THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
28 /============================================================================*/\r
29 \r
30 #define  STRICT\r
31 #include <windows.h>\r
32 #include <stdio.h>\r
33 #include <stdlib.h>\r
34 #include <string.h>\r
35 #include <mbstring.h>\r
36 #include <malloc.h>\r
37 #include <windowsx.h>\r
38 #include <commctrl.h>\r
39 #include <stdarg.h>\r
40 #include <winsock.h>\r
41 \r
42 #include "common.h"\r
43 #include "resource.h"\r
44 \r
45 \r
46 /*===== \83v\83\8d\83g\83^\83C\83v =====*/\r
47 \r
48 static void AddOpenMenu(HMENU hMenu, UINT Flg);\r
49 static LRESULT CALLBACK HistEditBoxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);\r
50 \r
51 /* 2007/09/21 sunasunamix  \82±\82±\82©\82ç *********************/\r
52 static LRESULT CALLBACK CountermeasureTbarMainProc(HWND hWnd,UINT uMessage,WPARAM wParam,LPARAM lParam);\r
53 static LRESULT CALLBACK CountermeasureTbarLocalProc(HWND hWnd,UINT uMessage,WPARAM wParam,LPARAM lParam);\r
54 static LRESULT CALLBACK CountermeasureTbarRemoteProc(HWND hWnd,UINT uMessage,WPARAM wParam,LPARAM lParam);\r
55 /********************************************* \82±\82±\82Ü\82Å */\r
56 \r
57 \r
58 /*===== \8aO\95\94\8eQ\8fÆ =====*/\r
59 \r
60 extern int SepaWidth;\r
61 extern int RemoteWidth;\r
62 \r
63 extern int CancelFlg;\r
64 \r
65 /* \90Ý\92è\92l */\r
66 extern int DotFile;\r
67 extern char AsciiExt[ASCII_EXT_LEN+1];\r
68 extern int TransMode;\r
69 extern int ListType;\r
70 extern int LocalWidth;\r
71 extern char ViewerName[VIEWERS][FMAX_PATH+1];\r
72 extern int TransMode;\r
73 extern int SortSave;\r
74 \r
75 /*===== \83\8d\81[\83J\83\8b\82È\83\8f\81[\83N =====*/\r
76 \r
77 static HWND hWndTbarMain = NULL;\r
78 static HWND hWndTbarLocal = NULL;\r
79 static HWND hWndTbarRemote = NULL;\r
80 static HWND hWndDirLocal = NULL;\r
81 static HWND hWndDirRemote = NULL;\r
82 static HWND hWndDirLocalEdit = NULL;\r
83 static HWND hWndDirRemoteEdit = NULL;\r
84 \r
85 static WNDPROC HistEditBoxProcPtr;\r
86 \r
87 static HFONT DlgFont = NULL;\r
88 \r
89 static int TmpTransMode;\r
90 static int TmpHostKanjiCode;\r
91 static int TmpHostKanaCnv;\r
92 \r
93 // TODO: \83\8d\81[\83J\83\8b\82Ì\8a¿\8e\9a\83R\81[\83h\82ðShift_JIS\88È\8aO\82É\82à\91Î\89\9e\r
94 static int TmpLocalKanjiCode;\r
95 \r
96 static int TmpLocalFileSort;\r
97 static int TmpLocalDirSort;\r
98 static int TmpRemoteFileSort;\r
99 static int TmpRemoteDirSort;\r
100 \r
101 static int SyncMove = NO;\r
102 \r
103 static int HideUI = NO;\r
104 \r
105 \r
106 /* 2007/09/21 sunasunamix  \82±\82±\82©\82ç *********************/\r
107 static WNDPROC pOldTbarMainProc   = NULL;\r
108 static WNDPROC pOldTbarLocalProc  = NULL;\r
109 static WNDPROC pOldTbarRemoteProc = NULL;\r
110 /********************************************* \82±\82±\82Ü\82Å */\r
111 \r
112 \r
113 /* \88È\91O\81A\83R\83\93\83{\83{\83b\83N\83X\82É\83J\83\8c\83\93\83g\83t\83H\83\8b\83_\82ð\89¯\82¦\82³\82¹\82Ä\82¢\82½\97¬\82ê\82Å */\r
114 /* \82±\82Ì\83t\83@\83C\83\8b\82Å\83J\83\8c\83\93\83g\83t\83H\83\8b\83_\82ð\89¯\82¦\82³\82¹\82é */\r
115 static char LocalCurDir[FMAX_PATH+1];\r
116 static char RemoteCurDir[FMAX_PATH+1];\r
117 \r
118 \r
119 /* \83\81\83C\83\93\82Ì\83c\81[\83\8b\83o\81[ */\r
120 static TBBUTTON TbarDataMain[] = {\r
121         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
122         { 0,  MENU_CONNECT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
123         { 16, MENU_QUICK, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
124         { 1,  MENU_DISCONNECT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
125         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
126         { 2,  MENU_DOWNLOAD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
127         { 3,  MENU_UPLOAD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
128         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
129         { 24, MENU_MIRROR_UPLOAD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
130         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
131         { 4,  MENU_DELETE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
132         { 5,  MENU_RENAME, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
133         { 6,  MENU_MKDIR, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
134         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
135         { 7,  MENU_TEXT, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
136         { 8,  MENU_BINARY, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
137         { 17, MENU_AUTO, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
138         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
139         { 27, MENU_L_KNJ_SJIS, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
140         { 20, MENU_L_KNJ_EUC, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
141         { 21, MENU_L_KNJ_JIS, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
142         { 28, MENU_L_KNJ_UTF8N, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
143         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
144         { 27, MENU_KNJ_SJIS, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
145         { 20, MENU_KNJ_EUC, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
146         { 21, MENU_KNJ_JIS, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
147         { 28, MENU_KNJ_UTF8N, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
148         { 22, MENU_KNJ_NONE, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
149         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
150         { 23, MENU_KANACNV, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, 0 },\r
151         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
152         { 15, MENU_REFRESH, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
153         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
154         { 18, MENU_LIST, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
155         { 19, MENU_REPORT, TBSTATE_ENABLED, TBSTYLE_CHECKGROUP, 0, 0 },\r
156         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
157         { 25, MENU_SYNC, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, 0 },\r
158         { 0,  0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
159         { 26, MENU_ABORT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 }\r
160 };\r
161 \r
162 /* \83\8d\81[\83J\83\8b\91¤\82Ì\83c\81[\83\8b\83o\81[ */\r
163 static TBBUTTON TbarDataLocal[] = {\r
164         { 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
165         { 0, MENU_LOCAL_UPDIR, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
166         { 1, MENU_LOCAL_CHDIR, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
167         { 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 }\r
168 };\r
169 \r
170 /* \83z\83X\83g\91¤\82Ì\83c\81[\83\8b\83o\81[ */\r
171 static TBBUTTON TbarDataRemote[] = {\r
172         { 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 },\r
173         { 0, MENU_REMOTE_UPDIR, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
174         { 1, MENU_REMOTE_CHDIR, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },\r
175         { 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 }\r
176 };\r
177 \r
178 /* \91S\83{\83^\83\93\81^\83\81\83j\83\85\81[\8d\80\96Ú */\r
179 static const int HideMenus[] = {\r
180         MENU_CONNECT,           MENU_QUICK,                     MENU_DISCONNECT,\r
181         MENU_SET_CONNECT,       MENU_IMPORT_WS,         MENU_EXIT,\r
182         MENU_DOWNLOAD,          MENU_UPLOAD,            MENU_DOWNLOAD_AS,       MENU_MIRROR_UPLOAD,\r
183         MENU_UPLOAD_AS,         MENU_DOWNLOAD_NAME,     MENU_MIRROR_UPLOAD,\r
184         MENU_FILESIZE,          MENU_DELETE,            MENU_RENAME,\r
185         MENU_CHMOD,                     MENU_MKDIR,                     MENU_SOMECMD,\r
186         MENU_SYNC,\r
187         MENU_BMARK_ADD,         MENU_BMARK_ADD_LOCAL, MENU_BMARK_ADD_BOTH,\r
188         MENU_BMARK_EDIT,\r
189         MENU_FILTER,            MENU_FIND,                      MENU_FINDNEXT,          MENU_SELECT,\r
190         MENU_SELECT_ALL,        MENU_LIST,                      MENU_REPORT,\r
191         MENU_SORT,                      MENU_DOTFILE,\r
192         MENU_DIRINFO,           MENU_TASKINFO,          MENU_REFRESH,\r
193         MENU_OPTION,\r
194         MENU_OTPCALC,\r
195         MENU_HELP,                      MENU_HELP_TROUBLE,      MENU_ABOUT,\r
196         MENU_REGINIT,\r
197         MENU_TEXT,                      MENU_BINARY,            MENU_AUTO,\r
198         MENU_KNJ_SJIS,          MENU_KNJ_EUC,           MENU_KNJ_JIS,           MENU_KNJ_UTF8N,         MENU_KNJ_NONE,\r
199         MENU_L_KNJ_SJIS,        MENU_L_KNJ_EUC,         MENU_L_KNJ_JIS,         MENU_L_KNJ_UTF8N,\r
200         MENU_KANACNV,\r
201         MENU_LOCAL_UPDIR,       MENU_LOCAL_CHDIR,\r
202         MENU_REMOTE_UPDIR,      MENU_REMOTE_CHDIR,\r
203         MENU_HIST_1,            MENU_HIST_2,            MENU_HIST_3,            MENU_HIST_4,\r
204         MENU_HIST_5,            MENU_HIST_6,            MENU_HIST_7,            MENU_HIST_8,\r
205         MENU_HIST_9,            MENU_HIST_10,           MENU_HIST_11,           MENU_HIST_12,\r
206         MENU_HIST_13,           MENU_HIST_14,           MENU_HIST_15,           MENU_HIST_16,\r
207         MENU_HIST_17,           MENU_HIST_18,           MENU_HIST_19,           MENU_HIST_20\r
208 };\r
209 \r
210 \r
211 \r
212 /*----- \83c\81[\83\8b\83o\81[\82ð\8dì\90¬\82·\82é --------------------------------------------------\r
213 *\r
214 *       Parameter\r
215 *               HWND hWnd : \90e\83E\83C\83\93\83h\83E\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
216 *               HINSTANCE hInst : \83C\83\93\83X\83^\83\93\83X\83n\83\93\83h\83\8b\r
217 *\r
218 *       Return Value\r
219 *               int \83X\83e\81[\83^\83X\r
220 *                       SUCCESS/FAIL\r
221 *----------------------------------------------------------------------------*/\r
222 \r
223 int MakeToolBarWindow(HWND hWnd, HINSTANCE hInst)\r
224 {\r
225         int Sts;\r
226         RECT Rect1;\r
227         char Tmp[FMAX_PATH+1];\r
228         char *Pos;\r
229         int Tmp2;\r
230         DWORD NoDrives;\r
231 \r
232         /*===== \83\81\83C\83\93\82Ì\83c\81[\83\8b\83o\81[ =====*/\r
233 \r
234         hWndTbarMain = CreateToolbarEx(\r
235                                 hWnd,\r
236                                 WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS | CCS_TOP,\r
237                                 1,\r
238                                 27,\r
239                                 hInst,\r
240                                 main_toolbar_bmp,\r
241                                 TbarDataMain,\r
242                                 sizeof(TbarDataMain)/sizeof(TBBUTTON),\r
243                                 16,16,\r
244                                 16,16,\r
245                                 sizeof(TBBUTTON));\r
246 \r
247         if(hWndTbarMain != NULL)\r
248         {\r
249                 /* 2007/09/21 sunasunamix  \82±\82±\82©\82ç *********************/\r
250                 pOldTbarMainProc = (WNDPROC)SetWindowLong(hWndTbarMain, GWL_WNDPROC, (DWORD)CountermeasureTbarMainProc);\r
251                 /********************************************* \82±\82±\82Ü\82Å */\r
252 \r
253                 GetClientRect(hWnd, &Rect1);\r
254                 MoveWindow(hWndTbarMain, 0, 0, Rect1.right, TOOLWIN_HEIGHT, FALSE);\r
255         }\r
256 \r
257         /*===== \83\8d\81[\83J\83\8b\82Ì\83c\81[\83\8b\83o\81[ =====*/\r
258 \r
259         hWndTbarLocal = CreateToolbarEx(\r
260                                 hWnd,\r
261                                 WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS | CCS_NORESIZE,\r
262                                 2,\r
263                                 2,\r
264                                 hInst,\r
265                                 remote_toolbar_bmp,\r
266                                 TbarDataLocal,\r
267                                 sizeof(TbarDataLocal)/sizeof(TBBUTTON),\r
268                                 16,16,\r
269                                 16,16,\r
270                                 sizeof(TBBUTTON));\r
271 \r
272         if(hWndTbarLocal != NULL)\r
273         {\r
274                 /* 2007/09/21 sunasunamix  \82±\82±\82©\82ç *********************/\r
275                 pOldTbarLocalProc = (WNDPROC)SetWindowLong(hWndTbarLocal, GWL_WNDPROC, (DWORD)CountermeasureTbarLocalProc);\r
276                 /********************************************* \82±\82±\82Ü\82Å */\r
277 \r
278                 MoveWindow(hWndTbarLocal, 0, TOOLWIN_HEIGHT, LocalWidth, TOOLWIN_HEIGHT, FALSE);\r
279 \r
280                 /*===== \83\8d\81[\83J\83\8b\82Ì\83f\83B\83\8c\83N\83g\83\8a\96¼\83E\83C\83\93\83h\83E =====*/\r
281 \r
282                 SendMessage(hWndTbarLocal, TB_GETITEMRECT, 3, (LPARAM)&Rect1);\r
283 #ifndef ENGLISH\r
284                 DlgFont = CreateFont(Rect1.bottom-Rect1.top-8, 0, 0, 0, 0, FALSE,FALSE,FALSE,SHIFTJIS_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,MSGJPN254);\r
285 #else\r
286                 DlgFont = CreateFont(Rect1.bottom-Rect1.top-8, 0, 0, 0, 0, FALSE,FALSE,FALSE,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,MSGJPN254);\r
287 #endif\r
288 \r
289                 hWndDirLocal = CreateWindowEx(WS_EX_CLIENTEDGE,\r
290                                         "COMBOBOX", "",\r
291                                         WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | CBS_DROPDOWN | CBS_SORT | CBS_AUTOHSCROLL,\r
292                                         Rect1.right, Rect1.top, LocalWidth - Rect1.right, 200,\r
293                                         hWndTbarLocal, (HMENU)COMBO_LOCAL, hInst, NULL);\r
294 \r
295                 if(hWndDirLocal != NULL)\r
296                 {\r
297                         /* \83G\83f\83B\83b\83g\83R\83\93\83g\83\8d\81[\83\8b\82ð\92T\82· */\r
298                         hWndDirLocalEdit = GetWindow(hWndDirLocal, GW_CHILD);\r
299                         if(hWndDirLocalEdit != NULL)\r
300                                 HistEditBoxProcPtr = (WNDPROC)SetWindowLong(hWndDirLocalEdit, GWL_WNDPROC, (LONG)HistEditBoxWndProc);\r
301 \r
302                         SendMessage(hWndDirLocal, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE, 0));\r
303                         SendMessage(hWndDirLocal, CB_LIMITTEXT, FMAX_PATH, 0);\r
304 \r
305                         /* \83h\83\89\83C\83u\96¼\82ð\83Z\83b\83g\82µ\82Ä\82¨\82­ */\r
306                         GetLogicalDriveStrings(FMAX_PATH, Tmp);\r
307                         NoDrives = LoadHideDriveListRegistory();\r
308                         Pos = Tmp;\r
309                         while(*Pos != NUL)\r
310                         {\r
311                                 Tmp2 = toupper(*Pos) - 'A';\r
312                                 if((NoDrives & (0x00000001 << Tmp2)) == 0)\r
313                                         SetLocalDirHist(Pos);\r
314                                 Pos = strchr(Pos, NUL) + 1;\r
315                         }\r
316                         SendMessage(hWndDirLocal, CB_SETCURSEL, 0, 0);\r
317                 }\r
318         }\r
319 \r
320         /*===== \83z\83X\83g\82Ì\83c\81[\83\8b\83o\81[ =====*/\r
321 \r
322         hWndTbarRemote = CreateToolbarEx(\r
323                                 hWnd,\r
324                                 WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS | CCS_NORESIZE,\r
325                                 3,\r
326                                 2,\r
327                                 hInst,\r
328                                 remote_toolbar_bmp,\r
329                                 TbarDataRemote,\r
330                                 sizeof(TbarDataRemote)/sizeof(TBBUTTON),\r
331                                 16,16,\r
332                                 16,16,\r
333                                 sizeof(TBBUTTON));\r
334 \r
335         if(hWndTbarRemote != NULL)\r
336         {\r
337                 /* 2007/09/21 sunasunamix  \82±\82±\82©\82ç *********************/\r
338                 pOldTbarRemoteProc = (WNDPROC)SetWindowLong(hWndTbarRemote, GWL_WNDPROC, (DWORD)CountermeasureTbarRemoteProc);\r
339                 /********************************************* \82±\82±\82Ü\82Å */\r
340 \r
341                 MoveWindow(hWndTbarRemote, LocalWidth + SepaWidth, TOOLWIN_HEIGHT, RemoteWidth, TOOLWIN_HEIGHT, FALSE);\r
342 \r
343                 /*===== \83z\83X\83g\82Ì\83f\83B\83\8c\83N\83g\83\8a\96¼\83E\83C\83\93\83h\83E =====*/\r
344 \r
345                 SendMessage(hWndTbarRemote, TB_GETITEMRECT, 3, (LPARAM)&Rect1);\r
346                 hWndDirRemote = CreateWindowEx(WS_EX_CLIENTEDGE,\r
347                                         "COMBOBOX", "",\r
348                                         WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | CBS_DROPDOWN | CBS_AUTOHSCROLL,\r
349                                         Rect1.right, Rect1.top, RemoteWidth - Rect1.right, 200,\r
350                                         hWndTbarRemote, (HMENU)COMBO_REMOTE, hInst, NULL);\r
351 \r
352                 if(hWndDirRemote != NULL)\r
353                 {\r
354                         /* \83G\83f\83B\83b\83g\83R\83\93\83g\83\8d\81[\83\8b\82ð\92T\82· */\r
355                         hWndDirRemoteEdit = GetWindow(hWndDirRemote, GW_CHILD);\r
356                         if(hWndDirRemoteEdit != NULL)\r
357                                 HistEditBoxProcPtr = (WNDPROC)SetWindowLong(hWndDirRemoteEdit, GWL_WNDPROC, (LONG)HistEditBoxWndProc);\r
358 \r
359                         SendMessage(hWndDirRemote, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE, 0));\r
360                         SendMessage(hWndDirRemote, CB_LIMITTEXT, FMAX_PATH, 0);\r
361                         SendMessage(hWndDirRemote, CB_SETCURSEL, 0, 0);\r
362                 }\r
363         }\r
364 \r
365         Sts = SUCCESS;\r
366         if((hWndTbarMain == NULL) ||\r
367            (hWndTbarLocal == NULL) ||\r
368            (hWndTbarRemote == NULL) ||\r
369            (hWndDirLocal == NULL) ||\r
370            (hWndDirRemote == NULL))\r
371         {\r
372                 Sts = FAIL;\r
373         }\r
374         return(Sts);\r
375 }\r
376 \r
377 \r
378 \r
379 \r
380 \r
381 static LRESULT CALLBACK HistEditBoxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)\r
382 {\r
383         char Tmp[FMAX_PATH+1];\r
384 \r
385         switch (message)\r
386         {\r
387                 case WM_CHAR :\r
388                         if(wParam == 0x0D)              /* \83\8a\83^\81[\83\93\83L\81[\82ª\89\9f\82³\82ê\82½ */\r
389                         {\r
390                                 if(hWnd == hWndDirLocalEdit)\r
391                                 {\r
392                                         SendMessage(hWndDirLocalEdit, WM_GETTEXT, FMAX_PATH+1, (LPARAM)Tmp);\r
393                                         DoLocalCWD(Tmp);\r
394                                         GetLocalDirForWnd();\r
395                                 }\r
396                                 else\r
397                                 {\r
398                                         SendMessage(hWndDirRemoteEdit, WM_GETTEXT, FMAX_PATH+1, (LPARAM)Tmp);\r
399                                         if(CheckClosedAndReconnect() == SUCCESS)\r
400                                         {\r
401                                                 if(DoCWD(Tmp, YES, NO, YES) < FTP_RETRY)\r
402                                                         GetRemoteDirForWnd(CACHE_NORMAL, &CancelFlg);\r
403                                         }\r
404                                 }\r
405                         }\r
406                         else if(wParam == 0x09)         /* TAB\83L\81[\82ª\89\9f\82³\82ê\82½ */\r
407                         {\r
408                                 if(hWnd == hWndDirLocalEdit)\r
409                                 {\r
410                                         SetFocus(GetLocalHwnd());\r
411                                 }\r
412                                 else\r
413                                 {\r
414                                         SetFocus(GetRemoteHwnd());\r
415                                 }\r
416                         }\r
417                         else\r
418                                 return(CallWindowProc(HistEditBoxProcPtr, hWnd, message, wParam, lParam));\r
419                         break;\r
420 \r
421                 default :\r
422                         return(CallWindowProc(HistEditBoxProcPtr, hWnd, message, wParam, lParam));\r
423         }\r
424     return(0L);\r
425 }\r
426 \r
427 \r
428 \r
429 \r
430 /*----- \83c\81[\83\8b\83o\81[\82ð\8dí\8f\9c ------------------------------------------------------\r
431 *\r
432 *       Parameter\r
433 *               \82È\82µ\r
434 *\r
435 *       Return Value\r
436 *               \82È\82µ\r
437 *----------------------------------------------------------------------------*/\r
438 \r
439 void DeleteToolBarWindow(void)\r
440 {\r
441 //      if(DlgFont != NULL)\r
442 //              DeleteObject(DlgFont);\r
443 \r
444         if(hWndTbarMain != NULL)\r
445                 DestroyWindow(hWndTbarMain);\r
446         if(hWndTbarLocal != NULL)\r
447                 DestroyWindow(hWndTbarLocal);\r
448         if(hWndTbarRemote != NULL)\r
449                 DestroyWindow(hWndTbarRemote);\r
450         if(hWndDirLocal != NULL)\r
451                 DestroyWindow(hWndDirLocal);\r
452         if(hWndDirRemote != NULL)\r
453                 DestroyWindow(hWndDirRemote);\r
454         return;\r
455 }\r
456 \r
457 \r
458 /*----- \83\81\83C\83\93\82Ì\83c\81[\83\8b\83o\81[\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\82ð\95Ô\82· --------------------------\r
459 *\r
460 *       Parameter\r
461 *               \82È\82µ\r
462 *\r
463 *       Return Value\r
464 *               HWND \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
465 *----------------------------------------------------------------------------*/\r
466 \r
467 HWND GetMainTbarWnd(void)\r
468 {\r
469         return(hWndTbarMain);\r
470 }\r
471 \r
472 \r
473 /*----- \83\8d\81[\83J\83\8b\91¤\82Ì\83q\83X\83g\83\8a\83E\83C\83\93\83h\83E\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\82ð\95Ô\82· --------------\r
474 *\r
475 *       Parameter\r
476 *               \82È\82µ\r
477 *\r
478 *       Return Value\r
479 *               HWND \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
480 *----------------------------------------------------------------------------*/\r
481 \r
482 HWND GetLocalHistHwnd(void)\r
483 {\r
484         return(hWndDirLocal);\r
485 }\r
486 \r
487 \r
488 /*----- \83z\83X\83g\91¤\82Ì\83q\83X\83g\83\8a\83E\83C\83\93\83h\83E\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\82ð\95Ô\82· ----------------\r
489 *\r
490 *       Parameter\r
491 *               \82È\82µ\r
492 *\r
493 *       Return Value\r
494 *               HWND \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
495 *----------------------------------------------------------------------------*/\r
496 \r
497 HWND GetRemoteHistHwnd(void)\r
498 {\r
499         return(hWndDirRemote);\r
500 }\r
501 \r
502 \r
503 /*----- \83\8d\81[\83J\83\8b\91¤\82Ì\83q\83X\83g\83\8a\83G\83f\83B\83b\83g\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\82ð\95Ô\82· --------------\r
504 *\r
505 *       Parameter\r
506 *               \82È\82µ\r
507 *\r
508 *       Return Value\r
509 *               HWND \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
510 *----------------------------------------------------------------------------*/\r
511 \r
512 HWND GetLocalHistEditHwnd(void)\r
513 {\r
514         return(hWndDirLocalEdit);\r
515 }\r
516 \r
517 \r
518 /*----- \83z\83X\83g\91¤\82Ì\83q\83X\83g\83\8a\83G\83f\83B\83b\83g\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\82ð\95Ô\82· ----------------\r
519 *\r
520 *       Parameter\r
521 *               \82È\82µ\r
522 *\r
523 *       Return Value\r
524 *               HWND \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
525 *----------------------------------------------------------------------------*/\r
526 \r
527 HWND GetRemoteHistEditHwnd(void)\r
528 {\r
529         return(hWndDirRemoteEdit);\r
530 }\r
531 \r
532 \r
533 /*----- \83\8d\81[\83J\83\8b\91¤\82Ì\83c\81[\83\8b\83o\81[\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\82ð\95Ô\82· ----------------------\r
534 *\r
535 *       Parameter\r
536 *               \82È\82µ\r
537 *\r
538 *       Return Value\r
539 *               HWND \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
540 *----------------------------------------------------------------------------*/\r
541 \r
542 HWND GetLocalTbarWnd(void)\r
543 {\r
544         return(hWndTbarLocal);\r
545 }\r
546 \r
547 \r
548 /*----- \83z\83X\83g\91¤\82Ì\83c\81[\83\8b\83o\81[\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\82ð\95Ô\82· ------------------------\r
549 *\r
550 *       Parameter\r
551 *               \82È\82µ\r
552 *\r
553 *       Return Value\r
554 *               HWND \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
555 *----------------------------------------------------------------------------*/\r
556 \r
557 HWND GetRemoteTbarWnd(void)\r
558 {\r
559         return(hWndTbarRemote);\r
560 }\r
561 \r
562 \r
563 /*----- HideUI \82Ì\8fó\91Ô\82ð\95Ô\82· ---------------------------------------------------\r
564 *\r
565 *       Parameter\r
566 *               \82È\82µ\r
567 *\r
568 *       Return Value\r
569 *               int HideUI \82Ì\8fó\91Ô\r
570 *----------------------------------------------------------------------------*/\r
571 \r
572 int GetHideUI(void)\r
573 {\r
574         return(HideUI);\r
575 }\r
576 \r
577 \r
578 /*----- \83c\81[\83\8b\83{\83^\83\93\81^\83\81\83j\83\85\81[\82Ì\83n\83C\83h\8f\88\97\9d ------------------------------------\r
579 *\r
580 *       Parameter\r
581 *               \82È\82µ\r
582 *\r
583 *       Return Value\r
584 *               \82È\82µ\r
585 *----------------------------------------------------------------------------*/\r
586 \r
587 void MakeButtonsFocus(void)\r
588 {\r
589         HWND hWndFocus;\r
590         HWND hWndMain;\r
591         int Count;\r
592         int Win;\r
593 \r
594         if(HideUI == NO)\r
595         {\r
596                 hWndMain = GetMainHwnd();\r
597                 hWndFocus = GetFocus();\r
598                 Win = WIN_LOCAL;\r
599                 if(hWndFocus == GetRemoteHwnd())\r
600                         Win = WIN_REMOTE;\r
601 \r
602                 Count = GetSelectedCount(Win);\r
603 \r
604                 if(AskConnecting() == YES)\r
605                 {\r
606                         EnableMenuItem(GetMenu(hWndMain), MENU_BMARK_ADD, MF_ENABLED);\r
607                         EnableMenuItem(GetMenu(hWndMain), MENU_BMARK_ADD_LOCAL, MF_ENABLED);\r
608                         EnableMenuItem(GetMenu(hWndMain), MENU_BMARK_ADD_BOTH, MF_ENABLED);\r
609                         EnableMenuItem(GetMenu(hWndMain), MENU_BMARK_EDIT, MF_ENABLED);\r
610                         EnableMenuItem(GetMenu(hWndMain), MENU_DIRINFO, MF_ENABLED);\r
611                         EnableMenuItem(GetMenu(hWndMain), MENU_MIRROR_UPLOAD, MF_ENABLED);\r
612                         EnableMenuItem(GetMenu(hWndMain), MENU_MIRROR_DOWNLOAD, MF_ENABLED);\r
613                         EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD_NAME, MF_ENABLED);\r
614                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_MIRROR_UPLOAD, MAKELONG(TRUE, 0));\r
615                 }\r
616                 else\r
617                 {\r
618                         EnableMenuItem(GetMenu(hWndMain), MENU_BMARK_ADD, MF_GRAYED);\r
619                         EnableMenuItem(GetMenu(hWndMain), MENU_BMARK_ADD_LOCAL, MF_GRAYED);\r
620                         EnableMenuItem(GetMenu(hWndMain), MENU_BMARK_ADD_BOTH, MF_GRAYED);\r
621                         EnableMenuItem(GetMenu(hWndMain), MENU_BMARK_EDIT, MF_GRAYED);\r
622                         EnableMenuItem(GetMenu(hWndMain), MENU_DIRINFO, MF_GRAYED);\r
623                         EnableMenuItem(GetMenu(hWndMain), MENU_MIRROR_UPLOAD, MF_GRAYED);\r
624                         EnableMenuItem(GetMenu(hWndMain), MENU_MIRROR_DOWNLOAD, MF_GRAYED);\r
625                         EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD_NAME, MF_GRAYED);\r
626                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_MIRROR_UPLOAD, MAKELONG(FALSE, 0));\r
627                 }\r
628 \r
629                 if(hWndFocus == GetLocalHwnd())\r
630                 {\r
631                         if((AskConnecting() == YES) && (Count > 0))\r
632                         {\r
633                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_UPLOAD, MAKELONG(TRUE, 0));\r
634                                 EnableMenuItem(GetMenu(hWndMain), MENU_UPLOAD, MF_ENABLED);\r
635                                 EnableMenuItem(GetMenu(hWndMain), MENU_UPLOAD_AS, MF_ENABLED);\r
636                         }\r
637                         else\r
638                         {\r
639                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_UPLOAD, MAKELONG(FALSE, 0));\r
640                                 EnableMenuItem(GetMenu(hWndMain), MENU_UPLOAD, MF_GRAYED);\r
641                                 EnableMenuItem(GetMenu(hWndMain), MENU_UPLOAD_AS, MF_GRAYED);\r
642                         }\r
643                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_DOWNLOAD, MAKELONG(FALSE, 0));\r
644                         EnableMenuItem(GetMenu(hWndMain), MENU_SOMECMD, MF_GRAYED);\r
645                         EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD, MF_GRAYED);\r
646                         EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD_AS, MF_GRAYED);\r
647                         EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD_AS_FILE, MF_GRAYED);\r
648                 }\r
649 \r
650                 if(hWndFocus == GetRemoteHwnd())\r
651                 {\r
652                         if(AskConnecting() == YES)\r
653                         {\r
654                                 EnableMenuItem(GetMenu(hWndMain), MENU_SOMECMD, MF_ENABLED);\r
655                         }\r
656                         else\r
657                         {\r
658                                 EnableMenuItem(GetMenu(hWndMain), MENU_SOMECMD, MF_GRAYED);\r
659                         }\r
660 \r
661                         if((AskConnecting() == YES) && (Count > 0))\r
662                         {\r
663                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_DOWNLOAD, MAKELONG(TRUE, 0));\r
664                                 EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD, MF_ENABLED);\r
665                                 EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD_AS, MF_ENABLED);\r
666                                 EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD_AS_FILE, MF_ENABLED);\r
667                         }\r
668                         else\r
669                         {\r
670                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_DOWNLOAD, MAKELONG(FALSE, 0));\r
671                                 EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD, MF_GRAYED);\r
672                                 EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD_AS, MF_GRAYED);\r
673                                 EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD_AS_FILE, MF_GRAYED);\r
674                         }\r
675                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_UPLOAD, MAKELONG(FALSE, 0));\r
676                         EnableMenuItem(GetMenu(hWndMain), MENU_UPLOAD, MF_GRAYED);\r
677                         EnableMenuItem(GetMenu(hWndMain), MENU_UPLOAD_AS, MF_GRAYED);\r
678                 }\r
679 \r
680                 if((hWndFocus == GetLocalHwnd()) || (hWndFocus == GetRemoteHwnd()))\r
681                 {\r
682                         if(Count > 0)\r
683                         {\r
684                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_DELETE, MAKELONG(TRUE, 0));\r
685                                 EnableMenuItem(GetMenu(hWndMain), MENU_DELETE, MF_ENABLED);\r
686                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_RENAME, MAKELONG(TRUE, 0));\r
687                                 EnableMenuItem(GetMenu(hWndMain), MENU_RENAME, MF_ENABLED);\r
688 \r
689                                 EnableMenuItem(GetMenu(hWndMain), MENU_CHMOD, MF_ENABLED);\r
690 \r
691                         }\r
692                         else\r
693                         {\r
694                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_DELETE, MAKELONG(FALSE, 0));\r
695                                 EnableMenuItem(GetMenu(hWndMain), MENU_DELETE, MF_GRAYED);\r
696                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_RENAME, MAKELONG(FALSE, 0));\r
697                                 EnableMenuItem(GetMenu(hWndMain), MENU_RENAME, MF_GRAYED);\r
698 \r
699                                 EnableMenuItem(GetMenu(hWndMain), MENU_CHMOD, MF_GRAYED);\r
700                         }\r
701 \r
702                         if((hWndFocus == GetLocalHwnd()) || (AskConnecting() == YES))\r
703                         {\r
704                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_MKDIR, MAKELONG(TRUE, 0));\r
705                                 EnableMenuItem(GetMenu(hWndMain), MENU_MKDIR, MF_ENABLED);\r
706                                 EnableMenuItem(GetMenu(hWndMain), MENU_FILESIZE, MF_ENABLED);\r
707                         }\r
708                         else\r
709                         {\r
710                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_MKDIR, MAKELONG(FALSE, 0));\r
711                                 EnableMenuItem(GetMenu(hWndMain), MENU_MKDIR, MF_GRAYED);\r
712                                 EnableMenuItem(GetMenu(hWndMain), MENU_FILESIZE, MF_GRAYED);\r
713                         }\r
714                 }\r
715                 else\r
716                 {\r
717                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_UPLOAD, MAKELONG(FALSE, 0));\r
718                         EnableMenuItem(GetMenu(hWndMain), MENU_UPLOAD, MF_GRAYED);\r
719                         EnableMenuItem(GetMenu(hWndMain), MENU_UPLOAD_AS, MF_GRAYED);\r
720                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_DOWNLOAD, MAKELONG(FALSE, 0));\r
721                         EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD, MF_GRAYED);\r
722                         EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD_AS, MF_GRAYED);\r
723                         EnableMenuItem(GetMenu(hWndMain), MENU_DOWNLOAD_AS_FILE, MF_GRAYED);\r
724                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_DELETE, MAKELONG(FALSE, 0));\r
725                         EnableMenuItem(GetMenu(hWndMain), MENU_DELETE, MF_GRAYED);\r
726                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_RENAME, MAKELONG(FALSE, 0));\r
727                         EnableMenuItem(GetMenu(hWndMain), MENU_RENAME, MF_GRAYED);\r
728                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_MKDIR, MAKELONG(FALSE, 0));\r
729                         EnableMenuItem(GetMenu(hWndMain), MENU_MKDIR, MF_GRAYED);\r
730                         EnableMenuItem(GetMenu(hWndMain), MENU_CHMOD, MF_GRAYED);\r
731                         EnableMenuItem(GetMenu(hWndMain), MENU_FILESIZE, MF_GRAYED);\r
732                         EnableMenuItem(GetMenu(hWndMain), MENU_SOMECMD, MF_GRAYED);\r
733                 }\r
734         }\r
735         return;\r
736 }\r
737 \r
738 \r
739 /*----- \83\86\81[\83U\82Ì\91\80\8dì\82ð\8bÖ\8e~\82·\82é ------------------------------------------------\r
740 *\r
741 *       Parameter\r
742 *               \82È\82µ\r
743 *\r
744 *       Return Value\r
745 *               \82È\82µ\r
746 *----------------------------------------------------------------------------*/\r
747 \r
748 void DisableUserOpe(void)\r
749 {\r
750         int i;\r
751 \r
752         HideUI = YES;\r
753 \r
754         for(i = 0; i < sizeof(HideMenus) / sizeof(int); i++)\r
755         {\r
756                 EnableMenuItem(GetMenu(GetMainHwnd()), HideMenus[i], MF_GRAYED);\r
757                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, HideMenus[i], MAKELONG(FALSE, 0));\r
758                 SendMessage(hWndTbarLocal, TB_ENABLEBUTTON, HideMenus[i], MAKELONG(FALSE, 0));\r
759                 SendMessage(hWndTbarRemote, TB_ENABLEBUTTON, HideMenus[i], MAKELONG(FALSE, 0));\r
760         }\r
761 \r
762         EnableWindow(hWndDirLocal, FALSE);\r
763         EnableWindow(hWndDirRemote, FALSE);\r
764 \r
765         return;\r
766 }\r
767 \r
768 \r
769 /*----- \83\86\81[\83U\82Ì\91\80\8dì\82ð\8b\96\89Â\82·\82é ------------------------------------------------\r
770 *\r
771 *       Parameter\r
772 *               \82È\82µ\r
773 *\r
774 *       Return Value\r
775 *               \82È\82µ\r
776 *----------------------------------------------------------------------------*/\r
777 \r
778 void EnableUserOpe(void)\r
779 {\r
780         int i;\r
781 \r
782         if(HideUI == YES)\r
783         {\r
784                 for(i = 0; i < sizeof(HideMenus) / sizeof(int); i++)\r
785                 {\r
786                         EnableMenuItem(GetMenu(GetMainHwnd()), HideMenus[i], MF_ENABLED);\r
787                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, HideMenus[i], MAKELONG(TRUE, 0));\r
788                         SendMessage(hWndTbarLocal, TB_ENABLEBUTTON, HideMenus[i], MAKELONG(TRUE, 0));\r
789                         SendMessage(hWndTbarRemote, TB_ENABLEBUTTON, HideMenus[i], MAKELONG(TRUE, 0));\r
790                 }\r
791                 EnableWindow(hWndDirLocal, TRUE);\r
792                 EnableWindow(hWndDirRemote, TRUE);\r
793 \r
794                 HideUI = NO;\r
795 \r
796                 MakeButtonsFocus();\r
797         }\r
798         return;\r
799 }\r
800 \r
801 \r
802 /*----- \83\86\81[\83U\82Ì\91\80\8dì\82ª\8bÖ\8e~\82³\82ê\82Ä\82¢\82é\82©\82Ç\82¤\82©\82ð\95Ô\82· ----------------------------\r
803 *\r
804 *       Parameter\r
805 *               \82È\82µ\r
806 *\r
807 *       Return Value\r
808 *               int \83X\83e\81[\83^\83X\r
809 *                       YES=\8bÖ\8e~\82³\82ê\82Ä\82¢\82é/NO\r
810 *----------------------------------------------------------------------------*/\r
811 \r
812 int AskUserOpeDisabled(void)\r
813 {\r
814         return(HideUI);\r
815 }\r
816 \r
817 \r
818 /*===================================================\r
819 *                       \93]\91\97\83\82\81[\83h\r
820 *===================================================*/\r
821 \r
822 /*----- \93]\91\97\83\82\81[\83h\82ð\90Ý\92è\82·\82é --------------------------------------------------\r
823 *\r
824 *       Parameter\r
825 *               int Mode : \93]\91\97\83\82\81[\83h (TYPE_xx)\r
826 *\r
827 *       Return Value\r
828 *               \82È\82µ\r
829 *----------------------------------------------------------------------------*/\r
830 \r
831 void SetTransferTypeImm(int Mode)\r
832 {\r
833         TmpTransMode = Mode;\r
834         HideHostKanjiButton();\r
835         HideLocalKanjiButton();\r
836         return;\r
837 }\r
838 \r
839 \r
840 /*----- \83\81\83j\83\85\81[\82É\82æ\82è\93]\91\97\83\82\81[\83h\82ð\90Ý\92è\82·\82é ------------------------------------\r
841 *\r
842 *       Parameter\r
843 *               int Type : \93]\91\97\83\82\81[\83h (MENU_xxxx)\r
844 *\r
845 *       Return Value\r
846 *               \82È\82µ\r
847 *----------------------------------------------------------------------------*/\r
848 \r
849 void SetTransferType(int Type)\r
850 {\r
851         switch(Type)\r
852         {\r
853                 case MENU_TEXT :\r
854                         TmpTransMode = TYPE_A;\r
855                         break;\r
856 \r
857                 case MENU_BINARY :\r
858                         TmpTransMode = TYPE_I;\r
859                         break;\r
860 \r
861                 default :\r
862                         TmpTransMode = TYPE_X;\r
863                         break;\r
864         }\r
865         HideHostKanjiButton();\r
866         HideLocalKanjiButton();\r
867         return;\r
868 }\r
869 \r
870 \r
871 /*----- \93]\91\97\83\82\81[\83h\82É\82µ\82½\82ª\82Á\82Ä\83{\83^\83\93\82ð\95\\8e¦\82·\82é --------------------------------\r
872 *\r
873 *       Parameter\r
874 *               \82È\82µ\r
875 *\r
876 *       Return Value\r
877 *               \82È\82µ\r
878 *----------------------------------------------------------------------------*/\r
879 \r
880 void DispTransferType(void)\r
881 {\r
882         switch(TmpTransMode)\r
883         {\r
884                 case TYPE_A :\r
885                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_TEXT, MAKELONG(TRUE, 0));\r
886                         break;\r
887 \r
888                 case TYPE_I :\r
889                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_BINARY, MAKELONG(TRUE, 0));\r
890                         break;\r
891 \r
892                 default :\r
893                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_AUTO, MAKELONG(TRUE, 0));\r
894                         break;\r
895         }\r
896         return;\r
897 }\r
898 \r
899 \r
900 /*----- \90Ý\92è\8fã\82Ì\93]\91\97\83\82\81[\83h\82ð\95Ô\82· ----------------------------------------------\r
901 *\r
902 *       Parameter\r
903 *               \82È\82µ\r
904 *\r
905 *       Return Value\r
906 *               int \93]\91\97\83\82\81[\83h (TYPE_xx)\r
907 *----------------------------------------------------------------------------*/\r
908 \r
909 int AskTransferType(void)\r
910 {\r
911         return(TmpTransMode);\r
912 }\r
913 \r
914 \r
915 /*----- \8eÀ\8dÛ\82Ì\93]\91\97\83\82\81[\83h\82ð\95Ô\82· ------------------------------------------------\r
916 *\r
917 *       Parameter\r
918 *               char Fname : \83t\83@\83C\83\8b\96¼\r
919 *               int Type : \90Ý\92è\8fã\82Ì\93]\91\97\83\82\81[\83h (TYPE_xx)\r
920 *\r
921 *       Return Value\r
922 *               int \93]\91\97\83\82\81[\83h (TYPE_xx)\r
923 *----------------------------------------------------------------------------*/\r
924 \r
925 int AskTransferTypeAssoc(char *Fname, int Type)\r
926 {\r
927         int Ret;\r
928         char *Pos;\r
929         char *Name;\r
930 \r
931         Ret = Type;\r
932         if(Ret == TYPE_X)\r
933         {\r
934                 Ret = TYPE_I;\r
935                 if(StrMultiLen(AsciiExt) > 0)\r
936                 {\r
937                         Name = GetFileName(Fname);\r
938                         Pos = AsciiExt;\r
939                         while(*Pos != NUL)\r
940                         {\r
941                                 if(CheckFname(Name, Pos) == SUCCESS)\r
942                                 {\r
943                                         Ret = TYPE_A;\r
944                                         break;\r
945                                 }\r
946                                 Pos += strlen(Pos) + 1;\r
947                         }\r
948                 }\r
949         }\r
950         return(Ret);\r
951 }\r
952 \r
953 \r
954 /*----- \93]\91\97\83\82\81[\83h\82ð\95Û\91\82·\82é --------------------------------------------------\r
955 *\r
956 *       Parameter\r
957 *               \82È\82µ\r
958 *\r
959 *       Return Value\r
960 *               \82È\82µ\r
961 *\r
962 *       Note\r
963 *               \8c»\8dÝ\82Ì\93]\91\97\83\82\81[\83h\82ª\83\8c\83W\83X\83g\83\8a\82É\95Û\91\82³\82ê\82é\r
964 *----------------------------------------------------------------------------*/\r
965 \r
966 void SaveTransferType(void)\r
967 {\r
968         TransMode = TmpTransMode;\r
969         return;\r
970 }\r
971 \r
972 \r
973 /*===================================================\r
974 *                       \8a¿\8e\9a\83\82\81[\83h\r
975 *===================================================*/\r
976 \r
977 /*----- \83z\83X\83g\82Ì\8a¿\8e\9a\83\82\81[\83h\82ð\83Z\83b\83g\82·\82é ----------------------------------------\r
978 *\r
979 *       Parameter\r
980 *               int Mode : \8a¿\8e\9a\83\82\81[\83h (KANJI_xxxx)\r
981 *\r
982 *       Return Value\r
983 *               \82È\82µ\r
984 *----------------------------------------------------------------------------*/\r
985 \r
986 void SetHostKanjiCodeImm(int Mode)\r
987 {\r
988         TmpHostKanjiCode = Mode;\r
989         DispHostKanjiCode();\r
990         HideHostKanjiButton();\r
991         return;\r
992 }\r
993 \r
994 \r
995 /*----- \83\81\83j\83\85\81[\82É\82æ\82è\83z\83X\83g\82Ì\8a¿\8e\9a\83\82\81[\83h\82ð\90Ý\92è\82·\82é -----------------------------\r
996 *\r
997 *       Parameter\r
998 *               int Type : \8a¿\8e\9a\83\82\81[\83h (MENU_xxxx)\r
999 *\r
1000 *       Return Value\r
1001 *               \82È\82µ\r
1002 *----------------------------------------------------------------------------*/\r
1003 \r
1004 void SetHostKanjiCode(int Type)\r
1005 {\r
1006         switch(Type)\r
1007         {\r
1008                 // UTF-8\91Î\89\9e\r
1009                 case MENU_KNJ_SJIS :\r
1010                         TmpHostKanjiCode = KANJI_SJIS;\r
1011                         break;\r
1012 \r
1013                 case MENU_KNJ_EUC :\r
1014                         TmpHostKanjiCode = KANJI_EUC;\r
1015                         break;\r
1016 \r
1017                 case MENU_KNJ_JIS :\r
1018                         TmpHostKanjiCode = KANJI_JIS;\r
1019                         break;\r
1020 \r
1021                 case MENU_KNJ_UTF8N :\r
1022                         TmpHostKanjiCode = KANJI_UTF8N;\r
1023                         break;\r
1024 \r
1025                 default :\r
1026                         TmpHostKanjiCode = KANJI_NOCNV;\r
1027                         break;\r
1028         }\r
1029         DispHostKanjiCode();\r
1030         HideHostKanjiButton();\r
1031         return;\r
1032 }\r
1033 \r
1034 \r
1035 /*----- \83z\83X\83g\82Ì\8a¿\8e\9a\83\82\81[\83h\82É\82µ\82½\82ª\82Á\82Ä\83{\83^\83\93\82ð\95\\8e¦\82·\82é ------------------------\r
1036 *\r
1037 *       Parameter\r
1038 *               \82È\82µ\r
1039 *\r
1040 *       Return Value\r
1041 *               \82È\82µ\r
1042 *----------------------------------------------------------------------------*/\r
1043 \r
1044 void DispHostKanjiCode(void)\r
1045 {\r
1046         switch(TmpHostKanjiCode)\r
1047         {\r
1048                 // UTF-8\91Î\89\9e\r
1049                 case KANJI_SJIS :\r
1050                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_KNJ_SJIS, MAKELONG(TRUE, 0));\r
1051                         break;\r
1052 \r
1053                 case KANJI_EUC :\r
1054                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_KNJ_EUC, MAKELONG(TRUE, 0));\r
1055                         break;\r
1056 \r
1057                 case KANJI_JIS :\r
1058                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_KNJ_JIS, MAKELONG(TRUE, 0));\r
1059                         break;\r
1060 \r
1061                 case KANJI_UTF8N :\r
1062                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_KNJ_UTF8N, MAKELONG(TRUE, 0));\r
1063                         break;\r
1064 \r
1065                 default :\r
1066                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_KNJ_NONE, MAKELONG(TRUE, 0));\r
1067                         break;\r
1068         }\r
1069         return;\r
1070 }\r
1071 \r
1072 \r
1073 /*----- \83z\83X\83g\82Ì\8a¿\8e\9a\83\82\81[\83h\82ð\95Ô\82· ----------------------------------------------\r
1074 *\r
1075 *       Parameter\r
1076 *               \82È\82µ\r
1077 *\r
1078 *       Return Value\r
1079 *               int \8a¿\8e\9a\83\82\81[\83h (KANJI_xxxx)\r
1080 *----------------------------------------------------------------------------*/\r
1081 \r
1082 int AskHostKanjiCode(void)\r
1083 {\r
1084         return(TmpHostKanjiCode);\r
1085 }\r
1086 \r
1087 \r
1088 /*----- \8a¿\8e\9a\83\82\81[\83h\83{\83^\83\93\82Ì\83n\83C\83h\8f\88\97\9d\82ð\8ds\82¤ ------------------------------------\r
1089 *\r
1090 *       Parameter\r
1091 *               \82È\82µ\r
1092 *\r
1093 *       Return Value\r
1094 *               \82È\82µ\r
1095 *----------------------------------------------------------------------------*/\r
1096 \r
1097 void HideHostKanjiButton(void)\r
1098 {\r
1099         switch(TmpTransMode)\r
1100         {\r
1101                 // UTF-8\91Î\89\9e\r
1102                 case TYPE_I : \r
1103                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_SJIS, MAKELONG(FALSE, 0));\r
1104                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_EUC, MAKELONG(FALSE, 0));\r
1105                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_JIS, MAKELONG(FALSE, 0));\r
1106                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_UTF8N, MAKELONG(FALSE, 0));\r
1107                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_NONE, MAKELONG(FALSE, 0));\r
1108                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(FALSE, 0));\r
1109                         break;\r
1110 \r
1111                 default :\r
1112                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_SJIS, MAKELONG(TRUE, 0));\r
1113                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_EUC, MAKELONG(TRUE, 0));\r
1114                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_JIS, MAKELONG(TRUE, 0));\r
1115                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_UTF8N, MAKELONG(TRUE, 0));\r
1116                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KNJ_NONE, MAKELONG(TRUE, 0));\r
1117                         if(TmpHostKanjiCode != KANJI_NOCNV)\r
1118                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(TRUE, 0));\r
1119                         else\r
1120                                 SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_KANACNV, MAKELONG(FALSE, 0));\r
1121                         break;\r
1122         }\r
1123         return;\r
1124 }\r
1125 \r
1126 \r
1127 // \83\8d\81[\83J\83\8b\82Ì\8a¿\8e\9a\83R\81[\83h\r
1128 // \83e\83L\83X\83g\83\82\81[\83h\93]\91\97\8e\9e\82É\8eg\97p\r
1129 // \83z\83X\83g\91¤\82ª\96³\95Ï\8a·\82Ì\8e\9e\82Í\83\8d\81[\83J\83\8b\82à\96³\95Ï\8a·\r
1130 \r
1131 void SetLocalKanjiCodeImm(int Mode)\r
1132 {\r
1133         TmpLocalKanjiCode = Mode;\r
1134         DispLocalKanjiCode();\r
1135         HideLocalKanjiButton();\r
1136         return;\r
1137 }\r
1138 \r
1139 void SetLocalKanjiCode(int Type)\r
1140 {\r
1141         switch(Type)\r
1142         {\r
1143                 // UTF-8\91Î\89\9e\r
1144                 case MENU_L_KNJ_SJIS :\r
1145                         TmpLocalKanjiCode = KANJI_SJIS;\r
1146                         break;\r
1147 \r
1148                 case MENU_L_KNJ_EUC :\r
1149 //                      TmpLocalKanjiCode = KANJI_EUC;\r
1150                         break;\r
1151 \r
1152                 case MENU_L_KNJ_JIS :\r
1153 //                      TmpLocalKanjiCode = KANJI_JIS;\r
1154                         break;\r
1155 \r
1156                 case MENU_L_KNJ_UTF8N :\r
1157                         TmpLocalKanjiCode = KANJI_UTF8N;\r
1158                         break;\r
1159         }\r
1160         DispLocalKanjiCode();\r
1161         HideLocalKanjiButton();\r
1162         return;\r
1163 }\r
1164 \r
1165 void DispLocalKanjiCode(void)\r
1166 {\r
1167         switch(TmpLocalKanjiCode)\r
1168         {\r
1169                 // UTF-8\91Î\89\9e\r
1170                 case KANJI_SJIS :\r
1171                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_L_KNJ_SJIS, MAKELONG(TRUE, 0));\r
1172                         break;\r
1173 \r
1174                 case KANJI_EUC :\r
1175 //                      SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_L_KNJ_EUC, MAKELONG(TRUE, 0));\r
1176                         break;\r
1177 \r
1178                 case KANJI_JIS :\r
1179 //                      SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_L_KNJ_JIS, MAKELONG(TRUE, 0));\r
1180                         break;\r
1181 \r
1182                 case KANJI_UTF8N :\r
1183                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_L_KNJ_UTF8N, MAKELONG(TRUE, 0));\r
1184                         break;\r
1185         }\r
1186         return;\r
1187 }\r
1188 \r
1189 int AskLocalKanjiCode(void)\r
1190 {\r
1191         return(TmpLocalKanjiCode);\r
1192 }\r
1193 \r
1194 void HideLocalKanjiButton(void)\r
1195 {\r
1196         switch(TmpTransMode)\r
1197         {\r
1198                 // UTF-8\91Î\89\9e\r
1199                 case TYPE_I : \r
1200                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_SJIS, MAKELONG(FALSE, 0));\r
1201                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_EUC, MAKELONG(FALSE, 0));\r
1202                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_JIS, MAKELONG(FALSE, 0));\r
1203                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_UTF8N, MAKELONG(FALSE, 0));\r
1204                         break;\r
1205 \r
1206                 default :\r
1207                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_SJIS, MAKELONG(TRUE, 0));\r
1208 //                      SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_EUC, MAKELONG(TRUE, 0));\r
1209 //                      SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_JIS, MAKELONG(TRUE, 0));\r
1210                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_UTF8N, MAKELONG(TRUE, 0));\r
1211                         // TODO: \8c»\8dÝEUC\82ÆJIS\82Í\94ñ\91Î\89\9e\r
1212                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_EUC, MAKELONG(FALSE, 0));\r
1213                         SendMessage(hWndTbarMain, TB_ENABLEBUTTON, MENU_L_KNJ_JIS, MAKELONG(FALSE, 0));\r
1214                         break;\r
1215         }\r
1216         return;\r
1217 }\r
1218 \r
1219 \r
1220 /*===================================================\r
1221 *                       \94¼\8ap\95Ï\8a·\83\82\81[\83h\r
1222 *===================================================*/\r
1223 \r
1224 /*----- \83z\83X\83g\82Ì\94¼\8ap\95Ï\8a·\83\82\81[\83h\82ð\90Ý\92è\82·\82é --------------------------------------\r
1225 *\r
1226 *       Parameter\r
1227 *               int Mode : \94¼\8ap\95Ï\8a·\83\82\81[\83h(YES/NO)\r
1228 *\r
1229 *       Return Value\r
1230 *               \82È\82µ\r
1231 *----------------------------------------------------------------------------*/\r
1232 \r
1233 void SetHostKanaCnvImm(int Mode)\r
1234 {\r
1235         TmpHostKanaCnv = Mode;\r
1236         DispHostKanaCnv();\r
1237         return;\r
1238 }\r
1239 \r
1240 \r
1241 /*----- \83z\83X\83g\82Ì\94¼\8ap\95Ï\8a·\83\82\81[\83h\82ð\94½\93]\82·\82é --------------------------------------\r
1242 *\r
1243 *       Parameter\r
1244 *               \82È\82µ\r
1245 *\r
1246 *       Return Value\r
1247 *               \82È\82µ\r
1248 *----------------------------------------------------------------------------*/\r
1249 \r
1250 void SetHostKanaCnv(void)\r
1251 {\r
1252         TmpHostKanaCnv ^= 1;\r
1253         DispHostKanaCnv();\r
1254         return;\r
1255 }\r
1256 \r
1257 \r
1258 /*----- \83z\83X\83g\82Ì\94¼\8ap\95Ï\8a·\83\82\81[\83h\82É\82µ\82½\82ª\82Á\82Ä\83{\83^\83\93\82ð\95\\8e¦\82·\82é --------------------\r
1259 *\r
1260 *       Parameter\r
1261 *               \82È\82µ\r
1262 *\r
1263 *       Return Value\r
1264 *               \82È\82µ\r
1265 *----------------------------------------------------------------------------*/\r
1266 \r
1267 void DispHostKanaCnv(void)\r
1268 {\r
1269         if(TmpHostKanaCnv != 0)\r
1270                 SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_KANACNV, MAKELONG(TRUE, 0));\r
1271         else\r
1272                 SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_KANACNV, MAKELONG(FALSE, 0));\r
1273         return;\r
1274 }\r
1275 \r
1276 \r
1277 /*----- \83z\83X\83g\82Ì\94¼\8ap\95Ï\8a·\83\82\81[\83h\82ð\95Ô\82· ------------------------------------------\r
1278 *\r
1279 *       Parameter\r
1280 *               \82È\82µ\r
1281 *\r
1282 *       Return Value\r
1283 *               int \94¼\8ap\95Ï\8a·\83\82\81[\83h\r
1284 *----------------------------------------------------------------------------*/\r
1285 \r
1286 int AskHostKanaCnv(void)\r
1287 {\r
1288         return(TmpHostKanaCnv);\r
1289 }\r
1290 \r
1291 \r
1292 /*===================================================\r
1293 *                       \83\\81[\83g\95û\96@\r
1294 *===================================================*/\r
1295 \r
1296 /*----- \83\\81[\83g\95û\96@\82ð\83Z\83b\83g\82·\82é ------------------------------------------------\r
1297 *\r
1298 *       Parameter\r
1299 *               int LFsort : \83\8d\81[\83J\83\8b\91¤\82Ì\83t\83@\83C\83\8b\82Ì\83\\81[\83g\95û\96@ (SORT_xxx)\r
1300 *               int LDsort : \83\8d\81[\83J\83\8b\91¤\82Ì\83f\83B\83\8c\83N\83g\83\8a\82Ì\83\\81[\83g\95û\96@ (SORT_xxx)\r
1301 *               int RFsort : \83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\82Ì\83\\81[\83g\95û\96@ (SORT_xxx)\r
1302 *               int RDsort : \83z\83X\83g\91¤\82Ì\83f\83B\83\8c\83N\83g\83\8a\82Ì\83\\81[\83g\95û\96@ (SORT_xxx)\r
1303 *\r
1304 *       Return Value\r
1305 *               \82È\82µ\r
1306 *----------------------------------------------------------------------------*/\r
1307 \r
1308 void SetSortTypeImm(int LFsort, int LDsort, int RFsort, int RDsort)\r
1309 {\r
1310         TmpLocalFileSort = LFsort;\r
1311         TmpLocalDirSort = LDsort;\r
1312         TmpRemoteFileSort = RFsort;\r
1313         TmpRemoteDirSort = RDsort;\r
1314         return;\r
1315 }\r
1316 \r
1317 \r
1318 /*----- \83\8a\83X\83g\83r\83\85\81[\82Ì\83^\83u\83N\83\8a\83b\83N\82É\82æ\82é\83\\81[\83g\95û\96@\82Ì\83Z\83b\83g --------------------\r
1319 *\r
1320 *       Parameter\r
1321 *               int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86\r
1322 *               int Tab : \83J\83\89\83\80\94Ô\8d\86\r
1323 *\r
1324 *       Return Value\r
1325 *               int \83\\81[\83g\95û\96@ (SORT_xxx)\r
1326 *----------------------------------------------------------------------------*/\r
1327 \r
1328 void SetSortTypeByColumn(int Win, int Tab)\r
1329 {\r
1330         if(Win == WIN_LOCAL)\r
1331         {\r
1332                 if((TmpLocalFileSort & SORT_MASK_ORD) == Tab)\r
1333                         TmpLocalFileSort ^= SORT_GET_ORD;\r
1334                 else\r
1335                         TmpLocalFileSort = Tab;\r
1336 \r
1337                 if((Tab == SORT_NAME) || (Tab == SORT_DATE))\r
1338                         TmpLocalDirSort = TmpLocalFileSort;\r
1339                 else\r
1340                         TmpLocalDirSort = SORT_NAME;\r
1341         }\r
1342         else\r
1343         {\r
1344                 if(Tab != 4)\r
1345                 {\r
1346                         if((TmpRemoteFileSort & SORT_MASK_ORD) == Tab)\r
1347                                 TmpRemoteFileSort ^= SORT_GET_ORD;\r
1348                         else\r
1349                                 TmpRemoteFileSort = Tab;\r
1350 \r
1351                         if((Tab == SORT_NAME) || (Tab == SORT_DATE))\r
1352                                 TmpRemoteDirSort = TmpRemoteFileSort;\r
1353                         else\r
1354                                 TmpRemoteDirSort = SORT_NAME;\r
1355                 }\r
1356         }\r
1357         return;\r
1358 }\r
1359 \r
1360 \r
1361 /*----- \83\\81[\83g\95û\96@\82ð\95Ô\82· ------------------------------------------------------\r
1362 *\r
1363 *       Parameter\r
1364 *               int Name : \82Ç\82Ì\95\94\95ª\82© (ITEM_xxx)\r
1365 *\r
1366 *       Return Value\r
1367 *               int \83\\81[\83g\95û\96@ (SORT_xxx)\r
1368 *----------------------------------------------------------------------------*/\r
1369 \r
1370 int AskSortType(int Name)\r
1371 {\r
1372         int Ret;\r
1373 \r
1374         switch(Name)\r
1375         {\r
1376                 case ITEM_LFILE :\r
1377                         Ret = TmpLocalFileSort;\r
1378                         break;\r
1379 \r
1380                 case ITEM_LDIR :\r
1381                         Ret = TmpLocalDirSort;\r
1382                         break;\r
1383 \r
1384                 case ITEM_RFILE :\r
1385                         Ret = TmpRemoteFileSort;\r
1386                         break;\r
1387 \r
1388                 case ITEM_RDIR :\r
1389                         Ret = TmpRemoteDirSort;\r
1390                         break;\r
1391         }\r
1392         return(Ret);\r
1393 }\r
1394 \r
1395 \r
1396 /*----- \83z\83X\83g\82²\82Æ\82É\83\\81[\83g\82ð\95Û\91\82·\82é\82©\82Ç\82¤\82©\82ð\83Z\83b\83g\82·\82é-----------------------\r
1397 *\r
1398 *       Parameter\r
1399 *               int Sw : \83X\83C\83b\83` (YES/NO)\r
1400 *\r
1401 *       Return Value\r
1402 *               \82È\82µ\r
1403 *----------------------------------------------------------------------------*/\r
1404 \r
1405 void SetSaveSortToHost(int Sw)\r
1406 {\r
1407         SortSave = Sw;\r
1408         return;\r
1409 }\r
1410 \r
1411 \r
1412 /*----- \83z\83X\83g\82²\82Æ\82É\83\\81[\83g\82ð\95Û\91\82·\82é\82©\82Ç\82¤\82©\82ð\95Ô\82· ----------------------------\r
1413 *\r
1414 *       Parameter\r
1415 *               \82È\82µ\r
1416 *\r
1417 *       Return Value\r
1418 *               int \83X\83C\83b\83` (YES/NO)\r
1419 *----------------------------------------------------------------------------*/\r
1420 \r
1421 int AskSaveSortToHost(void)\r
1422 {\r
1423         return(SortSave);\r
1424 }\r
1425 \r
1426 \r
1427 \r
1428 /*===================================================\r
1429 *                       \83\8a\83X\83g\83\82\81[\83h\r
1430 *===================================================*/\r
1431 \r
1432 /*----- \83\8a\83X\83g\83\82\81[\83h\82É\82µ\82½\82ª\82Á\82Ä\83{\83^\83\93\82ð\95\\8e¦\82·\82é ------------------------------\r
1433 *\r
1434 *       Parameter\r
1435 *               \82È\82µ\r
1436 *\r
1437 *       Return Value\r
1438 *               \82È\82µ\r
1439 *----------------------------------------------------------------------------*/\r
1440 \r
1441 void DispListType(void)\r
1442 {\r
1443         HWND hWndMain;\r
1444 \r
1445         hWndMain = GetMainHwnd();\r
1446         switch(ListType)\r
1447         {\r
1448                 case LVS_LIST :\r
1449                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_LIST, MAKELONG(TRUE, 0));\r
1450                         CheckMenuItem(GetMenu(hWndMain), MENU_LIST, MF_CHECKED);\r
1451                         CheckMenuItem(GetMenu(hWndMain), MENU_REPORT, MF_UNCHECKED);\r
1452                         break;\r
1453 \r
1454                 default :\r
1455                         SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_REPORT, MAKELONG(TRUE, 0));\r
1456                         CheckMenuItem(GetMenu(hWndMain), MENU_REPORT, MF_CHECKED);\r
1457                         CheckMenuItem(GetMenu(hWndMain), MENU_LIST, MF_UNCHECKED);\r
1458                         break;\r
1459         }\r
1460         return;\r
1461 }\r
1462 \r
1463 \r
1464 /*===================================================\r
1465 *                       \83t\83H\83\8b\83_\93¯\8e\9e\88Ú\93®\83\82\81[\83h\r
1466 *===================================================*/\r
1467 \r
1468 /*----- \93]\91\97\83\82\81[\83h\82ð\90Ý\92è\82·\82é --------------------------------------------------\r
1469 *\r
1470 *       Parameter\r
1471 *               int Mode : \93]\91\97\83\82\81[\83h (TYPE_xx)\r
1472 *\r
1473 *       Return Value\r
1474 *               \82È\82µ\r
1475 *----------------------------------------------------------------------------*/\r
1476 \r
1477 void SetSyncMoveMode(int Mode)\r
1478 {\r
1479         SyncMove = Mode;\r
1480         DispSyncMoveMode();\r
1481         return;\r
1482 }\r
1483 \r
1484 \r
1485 /*----- \83t\83H\83\8b\83_\93¯\8e\9e\88Ú\93®\83\82\81[\83h\82ð\90Ø\82è\91Ö\82¦\82é ------------------------------------\r
1486 *\r
1487 *       Parameter\r
1488 *               \82È\82µ\r
1489 *\r
1490 *       Return Value\r
1491 *               \82È\82µ\r
1492 *----------------------------------------------------------------------------*/\r
1493 \r
1494 void ToggleSyncMoveMode(void)\r
1495 {\r
1496         SyncMove ^= 1;\r
1497         DispSyncMoveMode();\r
1498         return;\r
1499 }\r
1500 \r
1501 \r
1502 /*----- \83t\83H\83\8b\83_\93¯\8e\9e\88Ú\93®\82ð\8ds\82¤\82©\82Ç\82¤\82©\82ð\82É\82æ\82Á\82Ä\83\81\83j\83\85\81[\81^\83{\83^\83\93\82ð\95\\8e¦ --------\r
1503 *\r
1504 *       Parameter\r
1505 *               \82È\82µ\r
1506 *\r
1507 *       Return Value\r
1508 *               \82È\82µ\r
1509 *----------------------------------------------------------------------------*/\r
1510 \r
1511 void DispSyncMoveMode(void)\r
1512 {\r
1513         if(SyncMove != 0)\r
1514         {\r
1515                 SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_SYNC, MAKELONG(TRUE, 0));\r
1516                 CheckMenuItem(GetMenu(GetMainHwnd()), MENU_SYNC, MF_CHECKED);\r
1517         }\r
1518         else\r
1519         {\r
1520                 SendMessage(hWndTbarMain, TB_CHECKBUTTON, MENU_SYNC, MAKELONG(FALSE, 0));\r
1521                 CheckMenuItem(GetMenu(GetMainHwnd()), MENU_SYNC, MF_UNCHECKED);\r
1522         }\r
1523         return;\r
1524 }\r
1525 \r
1526 \r
1527 /*----- \83t\83H\83\8b\83_\93¯\8e\9e\88Ú\93®\83\82\81[\83h\82ð\95Ô\82· ------------------------------------------\r
1528 *\r
1529 *       Parameter\r
1530 *               \82È\82µ\r
1531 *\r
1532 *       Return Value\r
1533 *               int \94¼\8ap\95Ï\8a·\83\82\81[\83h\r
1534 *----------------------------------------------------------------------------*/\r
1535 \r
1536 int AskSyncMoveMode(void)\r
1537 {\r
1538         return(SyncMove);\r
1539 }\r
1540 \r
1541 \r
1542 /*===================================================\r
1543 *                       \83f\83B\83\8c\83N\83g\83\8a\83q\83X\83g\83\8a\r
1544 *===================================================*/\r
1545 \r
1546 /*----- \83z\83X\83g\91¤\82Ì\83q\83X\83g\83\8a\88ê\97\97\83E\83C\83\93\83h\83E\82É\93o\98^ --------------------------------\r
1547 *\r
1548 *       Parameter\r
1549 *               char *Path : \83p\83X\r
1550 *\r
1551 *       Return Value\r
1552 *               \82È\82µ\r
1553 *----------------------------------------------------------------------------*/\r
1554 \r
1555 void SetRemoteDirHist(char *Path)\r
1556 {\r
1557         int i;\r
1558 \r
1559         if((i = SendMessage(hWndDirRemote, CB_FINDSTRINGEXACT, 0, (LPARAM)Path)) != CB_ERR)\r
1560                 SendMessage(hWndDirRemote, CB_DELETESTRING, i, 0);\r
1561 \r
1562         SendMessage(hWndDirRemote, CB_ADDSTRING, 0, (LPARAM)Path);\r
1563         i = SendMessage(hWndDirRemote, CB_GETCOUNT, 0, 0);\r
1564         SendMessage(hWndDirRemote, CB_SETCURSEL, i-1, 0);\r
1565 \r
1566         strcpy(RemoteCurDir, Path);\r
1567         return;\r
1568 }\r
1569 \r
1570 \r
1571 /*----- \83\8d\81[\83J\83\8b\91¤\82Ì\83q\83X\83g\83\8a\88ê\97\97\83E\83C\83\93\83h\83E\82É\93o\98^ -------------------------------\r
1572 *\r
1573 *       Parameter\r
1574 *               char *Path : \83p\83X\r
1575 *\r
1576 *       Return Value\r
1577 *               \82È\82µ\r
1578 *----------------------------------------------------------------------------*/\r
1579 \r
1580 void SetLocalDirHist(char *Path)\r
1581 {\r
1582         int i;\r
1583 \r
1584         if((i = SendMessage(hWndDirLocal, CB_FINDSTRINGEXACT, 0, (LPARAM)Path)) == CB_ERR)\r
1585                 SendMessage(hWndDirLocal, CB_ADDSTRING, 0, (LPARAM)Path);\r
1586         i = SendMessage(hWndDirLocal, CB_FINDSTRINGEXACT, 0, (LPARAM)Path);\r
1587         SendMessage(hWndDirLocal, CB_SETCURSEL, i, 0);\r
1588 \r
1589         strcpy(LocalCurDir, Path);\r
1590         return;\r
1591 }\r
1592 \r
1593 \r
1594 /*----- \83\8d\81[\83J\83\8b\82Ì\83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\82ð\95Ô\82· ----------------------------------\r
1595 *\r
1596 *       Parameter\r
1597 *               char *Buf : \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\96¼\82ð\95Ô\82·\83o\83b\83t\83@\r
1598 *               int Max : \83o\83b\83t\83@\82Ì\83T\83C\83Y\r
1599 *\r
1600 *       Return Value\r
1601 *               \82È\82µ\r
1602 *----------------------------------------------------------------------------*/\r
1603 \r
1604 void AskLocalCurDir(char *Buf, int Max)\r
1605 {\r
1606         memset(Buf, 0, Max);\r
1607         strncpy(Buf, LocalCurDir, Max-1);\r
1608         return;\r
1609 }\r
1610 \r
1611 \r
1612 /*----- \83z\83X\83g\82Ì\83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\82ð\95Ô\82· ------------------------------------\r
1613 *\r
1614 *       Parameter\r
1615 *               char *Buf : \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\96¼\82ð\95Ô\82·\83o\83b\83t\83@\r
1616 *               int Max : \83o\83b\83t\83@\82Ì\83T\83C\83Y\r
1617 *\r
1618 *       Return Value\r
1619 *               \82È\82µ\r
1620 *----------------------------------------------------------------------------*/\r
1621 \r
1622 void AskRemoteCurDir(char *Buf, int Max)\r
1623 {\r
1624         memset(Buf, 0, Max);\r
1625         strncpy(Buf, RemoteCurDir, Max-1);\r
1626         return;\r
1627 }\r
1628 \r
1629 \r
1630 /*----- \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\82ð\90Ý\92è\82·\82é ----------------------------------------\r
1631 *\r
1632 *       Parameter\r
1633 *               \82È\82µ\r
1634 *\r
1635 *       Return Value\r
1636 *               \82È\82µ\r
1637 *----------------------------------------------------------------------------*/\r
1638 \r
1639 void SetCurrentDirAsDirHist(void)\r
1640 {\r
1641         SetCurrentDirectory(LocalCurDir);\r
1642         return;\r
1643 }\r
1644 \r
1645 \r
1646 /*===================================================\r
1647 *                       \83\81\83j\83\85\81[\r
1648 *===================================================*/\r
1649 \r
1650 /*----- \83h\83b\83g\83t\83@\83C\83\8b\82ð\95\\8e¦\82·\82é\82©\82Ç\82¤\82©\82ð\83\81\83j\83\85\81[\82É\95\\8e¦\82·\82é ------------------\r
1651 *\r
1652 *       Parameter\r
1653 *               \82È\82µ\r
1654 *\r
1655 *       Return Value\r
1656 *               \82È\82µ\r
1657 *----------------------------------------------------------------------------*/\r
1658 \r
1659 void DispDotFileMode(void)\r
1660 {\r
1661         CheckMenuItem(GetMenu(GetMainHwnd()), MENU_DOTFILE, MF_UNCHECKED);\r
1662         if(DotFile == YES)\r
1663                 CheckMenuItem(GetMenu(GetMainHwnd()), MENU_DOTFILE, MF_CHECKED);\r
1664         return;\r
1665 }\r
1666 \r
1667 \r
1668 /*----- \83\8d\81[\83J\83\8b\91¤\82Ì\89E\83{\83^\83\93\83\81\83j\83\85\81[\82ð\95\\8e¦ ------------------------------------------------\r
1669 *\r
1670 *       Parameter\r
1671 *               int Pos : \83\81\83j\83\85\81[\82Ì\88Ê\92u\r
1672 *                                       0=\83}\83E\83X\83J\81[\83\\83\8b\82Ì\88Ê\92u\r
1673 *                                       1=\83E\83C\83\93\83h\83E\82Ì\8d\8fã\r
1674 *\r
1675 *       Return Value\r
1676 *               \82È\82µ\r
1677 *----------------------------------------------------------------------------*/\r
1678 \r
1679 void LocalRbuttonMenu(int Pos)\r
1680 {\r
1681         HMENU hMenu;\r
1682         POINT point;\r
1683         RECT Rect;\r
1684         UINT Flg1;\r
1685         UINT Flg2;\r
1686         UINT Flg3;\r
1687         int Count;\r
1688 \r
1689         if(HideUI == NO)\r
1690         {\r
1691                 Flg1 = 0;\r
1692                 if(AskConnecting() == NO)\r
1693                         Flg1 = MF_GRAYED;\r
1694 \r
1695                 Count = GetSelectedCount(WIN_LOCAL);\r
1696                 Flg2 = 0;\r
1697                 if(Count == 0)\r
1698                         Flg2 = MF_GRAYED;\r
1699 \r
1700                 Flg3 = 0;\r
1701                 if(Count != 1)\r
1702                         Flg3 = MF_GRAYED;\r
1703 \r
1704                 hMenu = CreatePopupMenu();\r
1705                 AddOpenMenu(hMenu, Flg3);\r
1706                 AppendMenu(hMenu, MF_STRING | Flg1 | Flg2, MENU_UPLOAD, MSGJPN255);\r
1707                 AppendMenu(hMenu, MF_STRING | Flg1 | Flg2, MENU_UPLOAD_AS, MSGJPN256);\r
1708                 AppendMenu(hMenu, MF_STRING | Flg1, MENU_UPLOAD_ALL, MSGJPN257);\r
1709                 AppendMenu(hMenu, MF_STRING | Flg2, MENU_DELETE, MSGJPN258);\r
1710                 AppendMenu(hMenu, MF_STRING | Flg2, MENU_RENAME, MSGJPN259);\r
1711                 AppendMenu(hMenu, MF_STRING , MENU_MKDIR, MSGJPN260);\r
1712                 AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);\r
1713                 AppendMenu(hMenu, MF_STRING , MENU_FILESIZE, MSGJPN261);\r
1714                 AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);\r
1715                 AppendMenu(hMenu, MF_STRING, REFRESH_LOCAL, MSGJPN262);\r
1716 \r
1717                 if(Pos == 0)\r
1718                         GetCursorPos(&point);\r
1719                 else\r
1720                 {\r
1721                         GetWindowRect(GetLocalHwnd(), &Rect);\r
1722                         point.x = Rect.left + 20;\r
1723                         point.y = Rect.top + 20;\r
1724                 }\r
1725                 TrackPopupMenu(hMenu, TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x, point.y, 0, GetMainHwnd(), NULL);\r
1726 \r
1727                 DestroyMenu(hMenu);\r
1728         }\r
1729         return;\r
1730 }\r
1731 \r
1732 \r
1733 /*----- \83z\83X\83g\91¤\82Ì\89E\83{\83^\83\93\83\81\83j\83\85\81[\82ð\95\\8e¦ --------------------------------------\r
1734 *\r
1735 *       Parameter\r
1736 *               int Pos : \83\81\83j\83\85\81[\82Ì\88Ê\92u\r
1737 *                                       0=\83}\83E\83X\83J\81[\83\\83\8b\82Ì\88Ê\92u\r
1738 *                                       1=\83E\83C\83\93\83h\83E\82Ì\8d\8fã\r
1739 *\r
1740 *       Return Value\r
1741 *               \82È\82µ\r
1742 *----------------------------------------------------------------------------*/\r
1743 \r
1744 void RemoteRbuttonMenu(int Pos)\r
1745 {\r
1746         HMENU hMenu;\r
1747         POINT point;\r
1748         RECT Rect;\r
1749         UINT Flg1;\r
1750         UINT Flg2;\r
1751         UINT Flg3;\r
1752         int Count;\r
1753 \r
1754         if(HideUI == NO)\r
1755         {\r
1756                 Flg1 = 0;\r
1757                 if(AskConnecting() == NO)\r
1758                         Flg1 = MF_GRAYED;\r
1759 \r
1760                 Count = GetSelectedCount(WIN_REMOTE);\r
1761                 Flg2 = 0;\r
1762                 if(Count == 0)\r
1763                         Flg2 = MF_GRAYED;\r
1764 \r
1765                 Flg3 = 0;\r
1766                 if(Count != 1)\r
1767                         Flg3 = MF_GRAYED;\r
1768 \r
1769                 hMenu = CreatePopupMenu();\r
1770                 AddOpenMenu(hMenu, Flg1 | Flg3);\r
1771                 AppendMenu(hMenu, MF_STRING | Flg1 | Flg2, MENU_DOWNLOAD, MSGJPN263);\r
1772                 AppendMenu(hMenu, MF_STRING | Flg1 | Flg2, MENU_DOWNLOAD_AS, MSGJPN264);\r
1773                 AppendMenu(hMenu, MF_STRING | Flg1 | Flg2, MENU_DOWNLOAD_AS_FILE, MSGJPN265);\r
1774                 AppendMenu(hMenu, MF_STRING | Flg1, MENU_DOWNLOAD_ALL, MSGJPN266);\r
1775                 AppendMenu(hMenu, MF_STRING | Flg1 | Flg2, MENU_DELETE, MSGJPN267);\r
1776                 AppendMenu(hMenu, MF_STRING | Flg1 | Flg2, MENU_RENAME, MSGJPN268);\r
1777                 AppendMenu(hMenu, MF_STRING | Flg1 | Flg2, MENU_CHMOD, MSGJPN269);\r
1778                 AppendMenu(hMenu, MF_STRING | Flg1, MENU_MKDIR, MSGJPN270);\r
1779                 AppendMenu(hMenu, MF_STRING | Flg1 | Flg2, MENU_URL_COPY, MSGJPN271);\r
1780                 AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);\r
1781                 AppendMenu(hMenu, MF_STRING | Flg1, MENU_FILESIZE, MSGJPN272);\r
1782                 AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);\r
1783                 AppendMenu(hMenu, MF_STRING | Flg1, REFRESH_REMOTE, MSGJPN273);\r
1784 \r
1785                 if(Pos == 0)\r
1786                         GetCursorPos(&point);\r
1787                 else\r
1788                 {\r
1789                         GetWindowRect(GetRemoteHwnd(), &Rect);\r
1790                         point.x = Rect.left + 20;\r
1791                         point.y = Rect.top + 20;\r
1792                 }\r
1793                 if(TrackPopupMenu(hMenu, TPM_LEFTBUTTON | TPM_RIGHTBUTTON, point.x, point.y, 0, GetMainHwnd(), NULL) == 0)\r
1794                         Count = GetLastError();\r
1795 \r
1796                 DestroyMenu(hMenu);\r
1797         }\r
1798         return;\r
1799 }\r
1800 \r
1801 \r
1802 /*----- \89E\83{\83^\83\93\83\81\83j\83\85\81[\82É\81u\8aJ\82­\81v\82ð\92Ç\89Á  -------------------------------------\r
1803 *\r
1804 *       Parameter\r
1805 *               HMENU hMenu : \83\81\83j\83\85\81[\83n\83\93\83h\83\8b\r
1806 *               UINT Flg : \83t\83\89\83O\r
1807 *\r
1808 *       Return Value\r
1809 *               \82È\82µ\r
1810 *----------------------------------------------------------------------------*/\r
1811 \r
1812 static void AddOpenMenu(HMENU hMenu, UINT Flg)\r
1813 {\r
1814         static const UINT MenuID[VIEWERS] = { MENU_OPEN1, MENU_OPEN2, MENU_OPEN3 };\r
1815         char Tmp[FMAX_PATH+1];\r
1816         int i;\r
1817 \r
1818         AppendMenu(hMenu, MF_STRING | Flg, MENU_DCLICK, MSGJPN274);\r
1819         for(i = 0; i < VIEWERS; i++)\r
1820         {\r
1821                 if(strlen(ViewerName[i]) != 0)\r
1822                 {\r
1823                         sprintf(Tmp, MSGJPN275, GetToolName(ViewerName[i]), i+1);\r
1824                         AppendMenu(hMenu, MF_STRING | Flg, MenuID[i], Tmp);\r
1825                 }\r
1826         }\r
1827         AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);\r
1828         return;\r
1829 }\r
1830 \r
1831 /* 2007/09/21 sunasunamix  \82±\82±\82©\82ç *********************/\r
1832 \r
1833 /*----- CreateToolbarEx \82Ì\83}\83E\83X\83N\83\8a\83b\83N\8aÖ\98A\82ð\96³\8e\8b\82·\82é(TbarMain\97p) -----------\r
1834 *       (\83T\83u\83N\83\89\83X\89»\82ð\8ds\82¤\82½\82ß\82Ì\83E\83C\83\93\83h\83E\83v\83\8d\83V\81[\83W\83\83)\r
1835 *----------------------------------------------------------------------------*/\r
1836 static LRESULT CALLBACK CountermeasureTbarMainProc(HWND hWnd,UINT uMessage,WPARAM wParam,LPARAM lParam)\r
1837 {\r
1838         switch (uMessage) {\r
1839         case WM_DESTROY :\r
1840                 SetWindowLong(hWnd,GWL_WNDPROC,(DWORD)pOldTbarMainProc);\r
1841                 break;\r
1842         case WM_RBUTTONDBLCLK :\r
1843         case WM_RBUTTONDOWN :\r
1844         case WM_RBUTTONUP :\r
1845                 return TRUE;\r
1846         }\r
1847         return CallWindowProc(pOldTbarMainProc, hWnd, uMessage, wParam, lParam);\r
1848 }\r
1849 \r
1850 /*----- CreateToolbarEx \82Ì\83}\83E\83X\83N\83\8a\83b\83N\8aÖ\98A\82ð\96³\8e\8b\82·\82é(TbarLocal\97p) ----------\r
1851 *       (\83T\83u\83N\83\89\83X\89»\82ð\8ds\82¤\82½\82ß\82Ì\83E\83C\83\93\83h\83E\83v\83\8d\83V\81[\83W\83\83)\r
1852 *----------------------------------------------------------------------------*/\r
1853 static LRESULT CALLBACK CountermeasureTbarLocalProc(HWND hWnd,UINT uMessage,WPARAM wParam,LPARAM lParam)\r
1854 {\r
1855         switch (uMessage) {\r
1856         case WM_DESTROY :\r
1857                 SetWindowLong(hWnd,GWL_WNDPROC,(DWORD)pOldTbarLocalProc);\r
1858                 break;\r
1859         case WM_RBUTTONDBLCLK :\r
1860         case WM_RBUTTONDOWN :\r
1861         case WM_RBUTTONUP :\r
1862                 return TRUE;\r
1863         }\r
1864         return CallWindowProc(pOldTbarLocalProc, hWnd, uMessage, wParam, lParam);\r
1865 }\r
1866 \r
1867 /*----- CreateToolbarEx \82Ì\83}\83E\83X\83N\83\8a\83b\83N\8aÖ\98A\82ð\96³\8e\8b\82·\82é(TbarRemote\97p) ---------\r
1868 *       (\83T\83u\83N\83\89\83X\89»\82ð\8ds\82¤\82½\82ß\82Ì\83E\83C\83\93\83h\83E\83v\83\8d\83V\81[\83W\83\83)\r
1869 *----------------------------------------------------------------------------*/\r
1870 static LRESULT CALLBACK CountermeasureTbarRemoteProc(HWND hWnd,UINT uMessage,WPARAM wParam,LPARAM lParam)\r
1871 {\r
1872         switch (uMessage) {\r
1873         case WM_DESTROY :\r
1874                 SetWindowLong(hWnd,GWL_WNDPROC,(DWORD)pOldTbarRemoteProc);\r
1875                 break;\r
1876         case WM_RBUTTONDBLCLK :\r
1877         case WM_RBUTTONDOWN :\r
1878         case WM_RBUTTONUP :\r
1879                 return TRUE;\r
1880         }\r
1881         return CallWindowProc(pOldTbarRemoteProc, hWnd, uMessage, wParam, lParam);\r
1882 }\r
1883 /********************************************* \82±\82±\82Ü\82Å */\r