OSDN Git Service

Fix bugs of UTF-8 to UTF-16 API bridge.
[ffftp/ffftp.git] / ftpproc.c
1 /*=============================================================================\r
2 *\r
3 *                                                               \82e\82s\82o\83R\83}\83\93\83h\91\80\8dì\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 <windowsx.h>\r
37 #include <commctrl.h>\r
38 \r
39 #include "common.h"\r
40 #include "resource.h"\r
41 \r
42 #include <htmlhelp.h>\r
43 #include "helpid.h"\r
44 \r
45 \r
46 /*===== \83v\83\8d\83g\83^\83C\83v =====*/\r
47 \r
48 static int CheckRemoteFile(TRANSPACKET *Pkt, FILELIST *ListList);\r
49 static BOOL CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
50 \r
51 static void DispMirrorFiles(FILELIST *Local, FILELIST *Remote);\r
52 static void MirrorDeleteAllLocalDir(FILELIST *Local, TRANSPACKET *Pkt, TRANSPACKET **Base);\r
53 static int CheckLocalFile(TRANSPACKET *Pkt);\r
54 static BOOL CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
55 static void RemoveAfterSemicolon(char *Path);\r
56 static void MirrorDeleteAllDir(FILELIST *Remote, TRANSPACKET *Pkt, TRANSPACKET **Base);\r
57 static BOOL CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
58 static BOOL CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
59 static void CountMirrorFiles(HWND hDlg, TRANSPACKET *Pkt);\r
60 static int AskMirrorNoTrn(char *Fname, int Mode);\r
61 static int AskUpLoadFileAttr(char *Fname);\r
62 static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
63 static void DeleteAllDir(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDir);\r
64 static void DelNotifyAndDo(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDir);\r
65 static BOOL CALLBACK DeleteDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
66 static BOOL CALLBACK RenameDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
67 static void SetAttrToDialog(HWND hWnd, int Attr);\r
68 static int GetAttrFromDialog(HWND hDlg);\r
69 static LRESULT CALLBACK SizeNotifyDlgWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
70 static LRESULT CALLBACK SizeDlgWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
71 static int RenameUnuseableName(char *Fname);\r
72 \r
73 /*===== \8aO\95\94\8eQ\8fÆ ====*/\r
74 \r
75 extern HWND hHelpWin;\r
76 \r
77 /* \90Ý\92è\92l */\r
78 extern int FnameCnv;\r
79 extern int RecvMode;\r
80 extern int SendMode;\r
81 extern int MoveMode;\r
82 extern char MirrorNoTrn[MIRROR_LEN+1];\r
83 extern char MirrorNoDel[MIRROR_LEN+1];\r
84 extern int MirrorFnameCnv;\r
85 extern char DefAttrList[DEFATTRLIST_LEN+1];\r
86 extern SIZE MirrorDlgSize;\r
87 extern int VaxSemicolon;\r
88 extern int DebugConsole;\r
89 extern int CancelFlg;\r
90 \r
91 /*===== \83\8d\81[\83J\83\8b\82È\83\8f\81[\83N =====*/\r
92 \r
93 static char TmpString[FMAX_PATH+80];            /* \83e\83\93\83|\83\89\83\8a */\r
94 static int CurWin;                                              /* \83E\83C\83\93\83h\83E\94Ô\8d\86 */\r
95 \r
96 int UpExistMode = EXIST_OVW;            /* \83A\83b\83v\83\8d\81[\83h\82Å\93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82 \82é\8e\9e\82Ì\88µ\82¢\95û EXIST_xxx */\r
97 int ExistMode = EXIST_OVW;              /* \93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82 \82é\8e\9e\82Ì\88µ\82¢\95û EXIST_xxx */\r
98 static int ExistNotify;         /* \8am\94F\83_\83C\83A\83\8d\83O\82ð\8fo\82·\82©\82Ç\82¤\82© YES/NO */\r
99 \r
100 static double FileSize;         /* \83t\83@\83C\83\8b\91\8d\97e\97Ê */\r
101 \r
102 \r
103 \r
104 /*----- \83t\83@\83C\83\8b\88ê\97\97\82Å\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82ð\83_\83E\83\93\83\8d\81[\83h\82·\82é --------------------\r
105 *\r
106 *       Parameter\r
107 *               int ChName : \96¼\91O\82ð\95Ï\82¦\82é\82©\82Ç\82¤\82© (YES/NO)\r
108 *               int ForceFile : \83f\83B\83\8c\83N\83g\83\8a\82ð\83t\83@\83C\83\8b\8c©\82È\82·\82©\82Ç\82¤\82© (YES/NO)\r
109 *               int All : \91S\82Ä\82ª\91I\82Î\82ê\82Ä\82¢\82é\95¨\82Æ\82µ\82Ä\88µ\82¤\82©\82Ç\82¤\82© (YES/NO)\r
110 *\r
111 *       Return Value\r
112 *               \82È\82µ\r
113 *----------------------------------------------------------------------------*/\r
114 \r
115 void DownLoadProc(int ChName, int ForceFile, int All)\r
116 {\r
117         FILELIST *FileListBase;\r
118         FILELIST *Pos;\r
119         TRANSPACKET Pkt;\r
120 \r
121         if(CheckClosedAndReconnect() == SUCCESS)\r
122         {\r
123                 DisableUserOpe();\r
124 \r
125                 ExistNotify = YES;\r
126 //              KeepTransferDialog(YES);\r
127 \r
128                 FileListBase = NULL;\r
129                 MakeSelectedFileList(WIN_REMOTE, (ForceFile == YES ? NO : YES), All, &FileListBase, &CancelFlg);\r
130 \r
131                 if(AskNoFullPathMode() == YES)\r
132                 {\r
133                         strcpy(Pkt.Cmd, "SETCUR");\r
134                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
135                         AddTransFileList(&Pkt);\r
136                 }\r
137 \r
138                 Pos = FileListBase;\r
139                 while(Pos != NULL)\r
140                 {\r
141                         AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
142                         SetYenTail(Pkt.LocalFile);\r
143                         strcpy(TmpString, Pos->File);\r
144                         if((ChName == NO) || ((ForceFile == NO) && (Pos->Node == NODE_DIR)))\r
145                         {\r
146                                 if(FnameCnv == FNAME_LOWER)\r
147                                         _mbslwr(TmpString);\r
148                                 else if(FnameCnv == FNAME_UPPER)\r
149                                         _mbsupr(TmpString);\r
150                                 RemoveAfterSemicolon(TmpString);\r
151                                 if(RenameUnuseableName(TmpString) == FAIL)\r
152                                         break;\r
153                         }\r
154                         else\r
155                         {\r
156                                 CurWin = WIN_REMOTE;\r
157                                 if(DialogBox(GetFtpInst(), MAKEINTRESOURCE(updown_as_dlg), GetMainHwnd(), UpDownAsDialogCallBack) == YES)\r
158                                 {\r
159                                         if(RenameUnuseableName(TmpString) == FAIL)\r
160                                                 break;\r
161                                 }\r
162                                 else\r
163                                         break;\r
164                         }\r
165                         strcat(Pkt.LocalFile, TmpString);\r
166                         ReplaceAll(Pkt.LocalFile, '/', '\\');\r
167 \r
168                         if((ForceFile == NO) && (Pos->Node == NODE_DIR))\r
169                         {\r
170                                 strcpy(Pkt.Cmd, "MKD ");\r
171                                 strcpy(Pkt.RemoteFile, "");\r
172                                 AddTransFileList(&Pkt);\r
173                         }\r
174                         else if((Pos->Node == NODE_FILE) ||\r
175                                         ((ForceFile == YES) && (Pos->Node == NODE_DIR)))\r
176                         {\r
177                                 if(AskHostType() == HTYPE_ACOS)\r
178                                 {\r
179                                         strcpy(Pkt.RemoteFile, "'");\r
180                                         strcat(Pkt.RemoteFile, AskHostLsName());\r
181                                         strcat(Pkt.RemoteFile, "(");\r
182                                         strcat(Pkt.RemoteFile, Pos->File);\r
183                                         strcat(Pkt.RemoteFile, ")");\r
184                                         strcat(Pkt.RemoteFile, "'");\r
185                                 }\r
186                                 else if(AskHostType() == HTYPE_ACOS_4)\r
187                                 {\r
188                                         strcpy(Pkt.RemoteFile, Pos->File);\r
189                                 }\r
190                                 else\r
191                                 {\r
192                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
193                                         SetSlashTail(Pkt.RemoteFile);\r
194                                         strcat(Pkt.RemoteFile, Pos->File);\r
195                                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
196                                 }\r
197 \r
198                                 strcpy(Pkt.Cmd, "RETR ");\r
199                                 Pkt.Type = AskTransferTypeAssoc(Pkt.RemoteFile, AskTransferType());\r
200                                 Pkt.Size = Pos->Size;\r
201                                 Pkt.Time = Pos->Time;\r
202                                 Pkt.KanjiCode = AskHostKanjiCode();\r
203                                 // UTF-8\91Î\89\9e\r
204                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
205                                 Pkt.KanaCnv = AskHostKanaCnv();\r
206 \r
207                                 Pkt.Mode = CheckLocalFile(&Pkt);        /* Pkt.ExistSize \82ª\83Z\83b\83g\82³\82ê\82é */\r
208                                 if(Pkt.Mode == EXIST_ABORT)\r
209                                         break;\r
210                                 else if(Pkt.Mode != EXIST_IGNORE)\r
211                                         AddTransFileList(&Pkt);\r
212                         }\r
213                         Pos = Pos->Next;\r
214                 }\r
215 \r
216                 if(AskNoFullPathMode() == YES)\r
217                 {\r
218                         strcpy(Pkt.Cmd, "BACKCUR");\r
219                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
220                         AddTransFileList(&Pkt);\r
221                 }\r
222                 DeleteFileList(&FileListBase);\r
223 \r
224                 strcpy(Pkt.Cmd, "GOQUIT");\r
225                 AddTransFileList(&Pkt);\r
226 \r
227                 GoForwardTransWindow();\r
228 //              KeepTransferDialog(NO);\r
229 \r
230                 EnableUserOpe();\r
231         }\r
232         return;\r
233 }\r
234 \r
235 \r
236 /*----- \8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82ð\88ê\82Â\83_\83E\83\93\83\8d\81[\83h\82·\82é ------------------------------\r
237 *\r
238 *       Parameter\r
239 *               char *Fname : \83t\83@\83C\83\8b\96¼\r
240 *\r
241 *       Return Value\r
242 *               \82È\82µ\r
243 *----------------------------------------------------------------------------*/\r
244 \r
245 void DirectDownLoadProc(char *Fname)\r
246 {\r
247         TRANSPACKET Pkt;\r
248 \r
249         if(CheckClosedAndReconnect() == SUCCESS)\r
250         {\r
251                 DisableUserOpe();\r
252 \r
253                 ExistNotify = YES;\r
254 //              KeepTransferDialog(YES);\r
255 \r
256                 if(AskNoFullPathMode() == YES)\r
257                 {\r
258                         strcpy(Pkt.Cmd, "SETCUR");\r
259                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
260                         AddTransFileList(&Pkt);\r
261                 }\r
262 \r
263                 if(strlen(Fname) > 0)\r
264                 {\r
265                         AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
266                         SetYenTail(Pkt.LocalFile);\r
267                         strcpy(TmpString, Fname);\r
268                         if(FnameCnv == FNAME_LOWER)\r
269                                 _mbslwr(TmpString);\r
270                         else if(FnameCnv == FNAME_UPPER)\r
271                                 _mbsupr(TmpString);\r
272                         RemoveAfterSemicolon(TmpString);\r
273 \r
274                         if(RenameUnuseableName(TmpString) == SUCCESS)\r
275                         {\r
276                                 strcat(Pkt.LocalFile, TmpString);\r
277                                 ReplaceAll(Pkt.LocalFile, '/', '\\');\r
278 \r
279                                 if(AskHostType() == HTYPE_ACOS)\r
280                                 {\r
281                                         strcpy(Pkt.RemoteFile, "'");\r
282                                         strcat(Pkt.RemoteFile, AskHostLsName());\r
283                                         strcat(Pkt.RemoteFile, "(");\r
284                                         strcat(Pkt.RemoteFile, Fname);\r
285                                         strcat(Pkt.RemoteFile, ")");\r
286                                         strcat(Pkt.RemoteFile, "'");\r
287                                 }\r
288                                 else if(AskHostType() == HTYPE_ACOS_4)\r
289                                 {\r
290                                         strcpy(Pkt.RemoteFile, Fname);\r
291                                 }\r
292                                 else\r
293                                 {\r
294                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
295                                         SetSlashTail(Pkt.RemoteFile);\r
296                                         strcat(Pkt.RemoteFile, Fname);\r
297                                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
298                                 }\r
299 \r
300                                 strcpy(Pkt.Cmd, "RETR-S ");\r
301                                 Pkt.Type = AskTransferTypeAssoc(Pkt.RemoteFile, AskTransferType());\r
302 \r
303                                 /* \83T\83C\83Y\82Æ\93ú\95t\82Í\93]\91\97\91¤\83X\83\8c\83b\83h\82Å\8eæ\93¾\82µ\81A\83Z\83b\83g\82·\82é */\r
304 \r
305                                 Pkt.KanjiCode = AskHostKanjiCode();\r
306                                 // UTF-8\91Î\89\9e\r
307                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
308                                 Pkt.KanaCnv = AskHostKanaCnv();\r
309 \r
310                                 Pkt.Mode = CheckLocalFile(&Pkt);        /* Pkt.ExistSize \82ª\83Z\83b\83g\82³\82ê\82é */\r
311                                 if((Pkt.Mode != EXIST_ABORT) && (Pkt.Mode != EXIST_IGNORE))\r
312                                         AddTransFileList(&Pkt);\r
313                         }\r
314                 }\r
315 \r
316                 if(AskNoFullPathMode() == YES)\r
317                 {\r
318                         strcpy(Pkt.Cmd, "BACKCUR");\r
319                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
320                         AddTransFileList(&Pkt);\r
321                 }\r
322 \r
323                 strcpy(Pkt.Cmd, "GOQUIT");\r
324                 AddTransFileList(&Pkt);\r
325 \r
326                 GoForwardTransWindow();\r
327 //              KeepTransferDialog(NO);\r
328 \r
329                 EnableUserOpe();\r
330         }\r
331         return;\r
332 }\r
333 \r
334 \r
335 /*----- \93ü\97Í\82³\82ê\82½\83t\83@\83C\83\8b\96¼\82Ì\83t\83@\83C\83\8b\82ð\88ê\82Â\83_\83E\83\93\83\8d\81[\83h\82·\82é ------------------\r
336 *\r
337 *       Parameter\r
338 *               \82È\82µ\r
339 *\r
340 *       Return Value\r
341 *               \82È\82µ\r
342 *----------------------------------------------------------------------------*/\r
343 \r
344 void InputDownLoadProc(void)\r
345 {\r
346         char Path[FMAX_PATH+1];\r
347         int Tmp;\r
348 \r
349 //      DisableUserOpe();\r
350 \r
351         strcpy(Path, "");\r
352         if(InputDialogBox(downname_dlg, GetMainHwnd(), NULL, Path, FMAX_PATH, &Tmp, IDH_HELP_TOPIC_0000001) == YES)\r
353         {\r
354                 DirectDownLoadProc(Path);\r
355         }\r
356 \r
357 //      EnableUserOpe();\r
358 \r
359         return;\r
360 }\r
361 \r
362 \r
363 /*----- \83~\83\89\81[\83\8a\83\93\83O\83_\83E\83\93\83\8d\81[\83h\82ð\8ds\82¤ ----------------------------------------\r
364 *\r
365 *       Parameter\r
366 *               int Notify : \8am\94F\82ð\8ds\82¤\82©\82Ç\82¤\82© (YES/NO)\r
367 *\r
368 *       Return Value\r
369 *               \82È\82µ\r
370 *----------------------------------------------------------------------------*/\r
371 \r
372 void MirrorDownloadProc(int Notify)\r
373 {\r
374         FILELIST *LocalListBase;\r
375         FILELIST *RemoteListBase;\r
376         FILELIST *LocalPos;\r
377         FILELIST *RemotePos;\r
378         TRANSPACKET Pkt;\r
379         TRANSPACKET *Base;\r
380         char Name[FMAX_PATH+1];\r
381         char *Cat;\r
382         int Level;\r
383         int Mode;\r
384 \r
385         if(CheckClosedAndReconnect() == SUCCESS)\r
386         {\r
387                 DisableUserOpe();\r
388 \r
389                 Base = NULL;\r
390 \r
391                 if(Notify == YES)\r
392                         Notify = DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(mirror_down_dlg), GetMainHwnd(), MirrorNotifyCallBack, 0);\r
393                 else\r
394                         Notify = YES;\r
395 \r
396                 if((Notify == YES) || (Notify == YES_LIST))\r
397                 {\r
398                         /*===== \83t\83@\83C\83\8b\83\8a\83X\83g\8eæ\93¾ =====*/\r
399 \r
400                         LocalListBase = NULL;\r
401                         MakeSelectedFileList(WIN_LOCAL, YES, YES, &LocalListBase, &CancelFlg);\r
402                         RemoteListBase = NULL;\r
403                         MakeSelectedFileList(WIN_REMOTE, YES, YES, &RemoteListBase, &CancelFlg);\r
404 \r
405                         RemotePos = RemoteListBase;\r
406                         while(RemotePos != NULL)\r
407                         {\r
408                                 RemotePos->Attr = YES;          /* RemotePos->Attr\82Í\93]\91\97\82·\82é\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O\82É\8eg\97p (YES/NO) */\r
409                                 RemotePos = RemotePos->Next;\r
410                         }\r
411 \r
412                         LocalPos = LocalListBase;\r
413                         while(LocalPos != NULL)\r
414                         {\r
415                                 if(AskMirrorNoTrn(LocalPos->File, 1) == NO)\r
416                                 {\r
417                                         LocalPos->Attr = YES;\r
418                                         LocalPos = LocalPos->Next;\r
419                                 }\r
420                                 else\r
421                                 {\r
422                                         LocalPos->Attr = NO;    /* LocalPos->Attr\82Í\8dí\8f\9c\82·\82é\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O\82É\8eg\97p (YES/NO) */\r
423 \r
424                                         if(LocalPos->Node == NODE_DIR)\r
425                                         {\r
426                                                 Level = AskDirLevel(LocalPos->File);\r
427                                                 LocalPos = LocalPos->Next;\r
428                                                 while(LocalPos != NULL)\r
429                                                 {\r
430                                                         if((LocalPos->Node == NODE_DIR) &&\r
431                                                            (AskDirLevel(LocalPos->File) <= Level))\r
432                                                         {\r
433                                                                 break;\r
434                                                         }\r
435                                                         LocalPos->Attr = NO;\r
436                                                         LocalPos = LocalPos->Next;\r
437                                                 }\r
438                                         }\r
439                                         else\r
440                                                 LocalPos = LocalPos->Next;\r
441                                 }\r
442                         }\r
443 \r
444                         /*===== \83t\83@\83C\83\8b\83\8a\83X\83g\94ä\8ar =====*/\r
445 \r
446                         RemotePos = RemoteListBase;\r
447                         while(RemotePos != NULL)\r
448                         {\r
449                                 if(AskMirrorNoTrn(RemotePos->File, 0) == NO)\r
450                                 {\r
451                                         strcpy(Name, RemotePos->File);\r
452 //                                      ReplaceAll(Name, '/', '\\');\r
453 \r
454                                         if(MirrorFnameCnv == YES)\r
455                                                 Mode = COMP_LOWERMATCH;\r
456                                         else\r
457                                                 Mode = COMP_STRICT;\r
458 \r
459                                         if((LocalPos = SearchFileList(Name, LocalListBase, Mode)) != NULL)\r
460                                         {\r
461                                                 if((RemotePos->Node == NODE_DIR) && (LocalPos->Node == NODE_DIR))\r
462                                                 {\r
463                                                         LocalPos->Attr = NO;\r
464                                                         RemotePos->Attr = NO;\r
465                                                 }\r
466                                                 else if((RemotePos->Node == NODE_FILE) && (LocalPos->Node == NODE_FILE))\r
467                                                 {\r
468                                                         LocalPos->Attr = NO;\r
469                                                         if(CompareFileTime(&RemotePos->Time, &LocalPos->Time) <= 0)\r
470                                                                 RemotePos->Attr = NO;\r
471                                                 }\r
472                                         }\r
473                                         RemotePos = RemotePos->Next;\r
474                                 }\r
475                                 else\r
476                                 {\r
477                                         if(RemotePos->Node == NODE_FILE)\r
478                                         {\r
479                                                 RemotePos->Attr = NO;\r
480                                                 RemotePos = RemotePos->Next;\r
481                                         }\r
482                                         else\r
483                                         {\r
484                                                 RemotePos->Attr = NO;\r
485                                                 Level = AskDirLevel(RemotePos->File);\r
486                                                 RemotePos = RemotePos->Next;\r
487                                                 while(RemotePos != NULL)\r
488                                                 {\r
489                                                         if((RemotePos->Node == NODE_DIR) &&\r
490                                                            (AskDirLevel(RemotePos->File) <= Level))\r
491                                                         {\r
492                                                                 break;\r
493                                                         }\r
494                                                         RemotePos->Attr = NO;\r
495                                                         RemotePos = RemotePos->Next;\r
496                                                 }\r
497                                         }\r
498                                 }\r
499                         }\r
500 \r
501                         DispMirrorFiles(LocalListBase, RemoteListBase);\r
502 \r
503                         /*===== \8dí\8f\9c\81^\83A\83b\83v\83\8d\81[\83h =====*/\r
504 \r
505                         LocalPos = LocalListBase;\r
506                         while(LocalPos != NULL)\r
507                         {\r
508                                 if((LocalPos->Attr == YES) && (LocalPos->Node == NODE_FILE))\r
509                                 {\r
510                                         AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
511                                         SetYenTail(Pkt.LocalFile);\r
512                                         strcat(Pkt.LocalFile, LocalPos->File);\r
513                                         ReplaceAll(Pkt.LocalFile, '/', '\\');\r
514                                         strcpy(Pkt.RemoteFile, "");\r
515                                         strcpy(Pkt.Cmd, "L-DELE ");\r
516                                         AddTmpTransFileList(&Pkt, &Base);\r
517                                 }\r
518                                 LocalPos = LocalPos->Next;\r
519                         }\r
520                         MirrorDeleteAllLocalDir(LocalListBase, &Pkt, &Base);\r
521 \r
522 \r
523                         RemotePos = RemoteListBase;\r
524                         while(RemotePos != NULL)\r
525                         {\r
526                                 if(RemotePos->Attr == YES)\r
527                                 {\r
528                                         AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
529                                         SetYenTail(Pkt.LocalFile);\r
530                                         Cat = strchr(Pkt.LocalFile, NUL);\r
531                                         strcat(Pkt.LocalFile, RemotePos->File);\r
532 \r
533                                         if(MirrorFnameCnv == YES)\r
534                                                 _mbslwr(Cat);\r
535 \r
536                                         RemoveAfterSemicolon(Cat);\r
537                                         ReplaceAll(Pkt.LocalFile, '/', '\\');\r
538 \r
539                                         if(RemotePos->Node == NODE_DIR)\r
540                                         {\r
541                                                 strcpy(Pkt.RemoteFile, "");\r
542                                                 strcpy(Pkt.Cmd, "L-MKD ");\r
543                                                 AddTmpTransFileList(&Pkt, &Base);\r
544                                         }\r
545                                         else if(RemotePos->Node == NODE_FILE)\r
546                                         {\r
547                                                 AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
548                                                 SetSlashTail(Pkt.RemoteFile);\r
549                                                 strcat(Pkt.RemoteFile, RemotePos->File);\r
550                                                 ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
551 \r
552                                                 strcpy(Pkt.Cmd, "RETR ");\r
553                                                 Pkt.Type = AskTransferTypeAssoc(Pkt.RemoteFile, AskTransferType());\r
554                                                 Pkt.Size = RemotePos->Size;\r
555                                                 Pkt.Time = RemotePos->Time;\r
556 //                                              Pkt.Attr = 0;\r
557                                                 Pkt.KanjiCode = AskHostKanjiCode();\r
558                                                 // UTF-8\91Î\89\9e\r
559                                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
560                                                 Pkt.KanaCnv = AskHostKanaCnv();\r
561                                                 Pkt.Mode = EXIST_OVW;\r
562                                                 AddTmpTransFileList(&Pkt, &Base);\r
563                                         }\r
564                                 }\r
565                                 RemotePos = RemotePos->Next;\r
566                         }\r
567 \r
568                         if((Notify == YES) ||\r
569                            (DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(mirrordown_notify_dlg), GetMainHwnd(), MirrorDispListCallBack, (LPARAM)&Base) == YES))\r
570                         {\r
571                                 if(AskNoFullPathMode() == YES)\r
572                                 {\r
573                                         strcpy(Pkt.Cmd, "SETCUR");\r
574                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
575                                         AddTransFileList(&Pkt);\r
576                                 }\r
577                                 AppendTransFileList(Base);\r
578 \r
579                                 if(AskNoFullPathMode() == YES)\r
580                                 {\r
581                                         strcpy(Pkt.Cmd, "BACKCUR");\r
582                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
583                                         AddTransFileList(&Pkt);\r
584                                 }\r
585 \r
586                                 strcpy(Pkt.Cmd, "GOQUIT");\r
587                                 AddTransFileList(&Pkt);\r
588                         }\r
589                         else\r
590                                 EraseTmpTransFileList(&Base);\r
591 \r
592                         DeleteFileList(&LocalListBase);\r
593                         DeleteFileList(&RemoteListBase);\r
594 \r
595                         GoForwardTransWindow();\r
596                 }\r
597 \r
598                 EnableUserOpe();\r
599         }\r
600         return;\r
601 }\r
602 \r
603 \r
604 /*----- \83~\83\89\81[\83\8a\83\93\83O\82Ì\83t\83@\83C\83\8b\88ê\97\97\82ð\95\\8e¦ --------------------------------------\r
605 *\r
606 *       Parameter\r
607 *               FILELIST *Local : \83\8d\81[\83J\83\8b\91¤\r
608 *               FILELIST *Remote : \83\8a\83\82\81[\83g\91¤\r
609 *\r
610 *       Return Value\r
611 *               \82È\82µ\r
612 *----------------------------------------------------------------------------*/\r
613 \r
614 static void DispMirrorFiles(FILELIST *Local, FILELIST *Remote)\r
615 {\r
616         char Date[80];\r
617         SYSTEMTIME sTime;\r
618         FILETIME fTime;\r
619 \r
620         if(DebugConsole == YES)\r
621         {\r
622                 DoPrintf("---- MIRROR FILE LIST ----");\r
623                 while(Local != NULL)\r
624                 {\r
625                         FileTimeToLocalFileTime(&Local->Time, &fTime);\r
626                         FileTimeToSystemTime(&fTime, &sTime);\r
627                         sprintf(Date, "%04d/%02d/%02d %02d:%02d:%02d.%04d", \r
628                                 sTime.wYear, sTime.wMonth, sTime.wDay, sTime.wHour, sTime.wMinute, sTime.wSecond, sTime.wMilliseconds);\r
629                         DoPrintf("LOCAL  : %s %s [%s] %s", Local->Attr==1?"YES":"NO ", Local->Node==NODE_DIR?"DIR ":"FILE", Date, Local->File);\r
630                         Local = Local->Next;\r
631                 }\r
632                 while(Remote != NULL)\r
633                 {\r
634                         FileTimeToLocalFileTime(&Remote->Time, &fTime);\r
635                         FileTimeToSystemTime(&fTime, &sTime);\r
636                         sprintf(Date, "%04d/%02d/%02d %02d:%02d:%02d.%04d", \r
637                                 sTime.wYear, sTime.wMonth, sTime.wDay, sTime.wHour, sTime.wMinute, sTime.wSecond, sTime.wMilliseconds);\r
638                         DoPrintf("REMOTE : %s %s [%s] %s", Remote->Attr==1?"YES":"NO ", Remote->Node==NODE_DIR?"DIR ":"FILE", Date, Remote->File);\r
639                         Remote = Remote->Next;\r
640                 }\r
641                 DoPrintf("---- END ----");\r
642         }\r
643         return;\r
644 }\r
645 \r
646 \r
647 /*----- \83~\83\89\81[\83\8a\83\93\83O\8e\9e\82Ì\83\8d\81[\83J\83\8b\91¤\82Ì\83t\83H\83\8b\83_\8dí\8f\9c ------------------------------\r
648 *\r
649 *       Parameter\r
650 *               FILELIST *Local : \83t\83@\83C\83\8b\83\8a\83X\83g\r
651 *               TRANSPACKET *Pkt : \r
652 *               TRANSPACKET **Base : \r
653 *\r
654 *       Return Value\r
655 *               \82È\82µ\r
656 *----------------------------------------------------------------------------*/\r
657 \r
658 static void MirrorDeleteAllLocalDir(FILELIST *Local, TRANSPACKET *Pkt, TRANSPACKET **Base)\r
659 {\r
660         while(Local != NULL)\r
661         {\r
662                 if(Local->Node == NODE_DIR)\r
663                 {\r
664                         MirrorDeleteAllLocalDir(Local->Next, Pkt, Base);\r
665 \r
666                         if(Local->Attr == YES)\r
667                         {\r
668                                 AskLocalCurDir(Pkt->LocalFile, FMAX_PATH);\r
669                                 SetYenTail(Pkt->LocalFile);\r
670                                 strcat(Pkt->LocalFile, Local->File);\r
671                                 ReplaceAll(Pkt->LocalFile, '/', '\\');\r
672                                 strcpy(Pkt->RemoteFile, "");\r
673                                 strcpy(Pkt->Cmd, "L-RMD ");\r
674                                 AddTmpTransFileList(Pkt, Base);\r
675                         }\r
676                         break;\r
677                 }\r
678                 Local = Local->Next;\r
679         }\r
680         return;\r
681 }\r
682 \r
683 \r
684 /*----- \83t\83@\83C\83\8b\96¼\82Ì\83Z\83~\83R\83\8d\83\93\88È\8d~\82ð\8eæ\82è\8f\9c\82­ ----------------------------------\r
685 *\r
686 *       Parameter\r
687 *               char *Path : \83t\83@\83C\83\8b\96¼\r
688 *\r
689 *       Return Value\r
690 *               \82È\82µ\r
691 *\r
692 *       Note\r
693 *               Path\82Ì\93à\97e\82ª\8f\91\82«\8a·\82¦\82ç\82ê\82é\r
694 *               \83I\83v\83V\83\87\83\93\90Ý\92è\82É\82æ\82Á\82Ä\8f\88\97\9d\82ð\90Ø\91Ö\82¦\82é\r
695 *----------------------------------------------------------------------------*/\r
696 \r
697 static void RemoveAfterSemicolon(char *Path)\r
698 {\r
699         char *Pos;\r
700 \r
701         if(VaxSemicolon == YES)\r
702         {\r
703                 if((Pos = strchr(Path, ';')) != NULL)\r
704                         *Pos = NUL;\r
705         }\r
706         return;\r
707 }\r
708 \r
709 \r
710 /*----- \83\8d\81[\83J\83\8b\82É\93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82È\82¢\82©\83`\83F\83b\83N --------------------------\r
711 *\r
712 *       Parameter\r
713 *               TRANSPACKET *Pkt : \93]\91\97\83t\83@\83C\83\8b\8fî\95ñ\r
714 *\r
715 *       Return Value\r
716 *               int \8f\88\97\9d\95û\96@\r
717 *                       EXIST_OVW/EXIST_RESUME/EXIST_IGNORE\r
718 *\r
719 *       Note\r
720 *               Pkt.ExistSize, ExistMode\81AExistNotify \82ª\95Ï\8dX\82³\82ê\82é\r
721 *----------------------------------------------------------------------------*/\r
722 \r
723 static int CheckLocalFile(TRANSPACKET *Pkt)\r
724 {\r
725         HANDLE fHnd;\r
726         WIN32_FIND_DATA Find;\r
727         int Ret;\r
728 \r
729         Ret = EXIST_OVW;\r
730         Pkt->ExistSize = 0;\r
731         if(RecvMode != TRANS_OVW)\r
732         {\r
733                 if((fHnd = FindFirstFile(Pkt->LocalFile, &Find)) != INVALID_HANDLE_VALUE)\r
734                 {\r
735                         FindClose(fHnd);\r
736 \r
737                         Pkt->ExistSize = MakeLongLong(Find.nFileSizeHigh, Find.nFileSizeLow);\r
738 \r
739                         if(ExistNotify == YES)\r
740                         {\r
741                                 SoundPlay(SND_ERROR);\r
742                                 if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(down_exist_dlg), GetMainHwnd(), DownExistDialogCallBack, (LPARAM)Pkt) == NO)\r
743                                         Ret = EXIST_ABORT;\r
744                                 else\r
745                                         Ret = ExistMode;\r
746                         }\r
747                         else\r
748                                 Ret = ExistMode;\r
749 \r
750                         if(Ret == EXIST_NEW)\r
751                         {\r
752                                 /*\83t\83@\83C\83\8b\93ú\95t\83`\83F\83b\83N */\r
753                                 if(CompareFileTime(&Find.ftLastWriteTime, &Pkt->Time) < 0)\r
754                                         Ret = EXIST_OVW;\r
755                                 else\r
756                                         Ret = EXIST_IGNORE;\r
757                         }\r
758                 }\r
759         }\r
760         return(Ret);\r
761 }\r
762 \r
763 \r
764 /*----- \83\8d\81[\83J\83\8b\82É\93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82 \82é\8e\9e\82Ì\8am\94F\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ----\r
765 *\r
766 *       Parameter\r
767 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
768 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
769 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
770 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
771 *\r
772 *       Return Value\r
773 *               BOOL TRUE/FALSE\r
774 *----------------------------------------------------------------------------*/\r
775 \r
776 static BOOL CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
777 {\r
778         static TRANSPACKET *Pkt;\r
779         static const RADIOBUTTON DownExistButton[] = {\r
780                 { DOWN_EXIST_OVW, EXIST_OVW },\r
781                 { DOWN_EXIST_NEW, EXIST_NEW },\r
782                 { DOWN_EXIST_RESUME, EXIST_RESUME },\r
783                 { DOWN_EXIST_IGNORE, EXIST_IGNORE }\r
784         };\r
785         #define DOWNEXISTBUTTONS        (sizeof(DownExistButton)/sizeof(RADIOBUTTON))\r
786 \r
787         switch (iMessage)\r
788         {\r
789                 case WM_INITDIALOG :\r
790                         Pkt = (TRANSPACKET *)lParam;\r
791                         SendDlgItemMessage(hDlg, DOWN_EXIST_NAME, EM_LIMITTEXT, FMAX_PATH, 0);\r
792                         SendDlgItemMessage(hDlg, DOWN_EXIST_NAME, WM_SETTEXT, 0, (LPARAM)Pkt->LocalFile);\r
793 \r
794                         if((Pkt->Type == TYPE_A) || (Pkt->ExistSize <= 0))\r
795                                 EnableWindow(GetDlgItem(hDlg, DOWN_EXIST_RESUME), FALSE);\r
796 \r
797                         SetRadioButtonByValue(hDlg, ExistMode, DownExistButton, DOWNEXISTBUTTONS);\r
798                         return(TRUE);\r
799 \r
800                 case WM_COMMAND :\r
801                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
802                         {\r
803                                 case IDOK_ALL :\r
804                                         ExistNotify = NO;\r
805                                         /* \82±\82±\82É break \82Í\82È\82¢ */\r
806 \r
807                                 case IDOK :\r
808                                         ExistMode = AskRadioButtonValue(hDlg, DownExistButton, DOWNEXISTBUTTONS);\r
809                                         SendDlgItemMessage(hDlg, DOWN_EXIST_NAME, WM_GETTEXT, FMAX_PATH, (LPARAM)Pkt->LocalFile);\r
810                                         EndDialog(hDlg, YES);\r
811                                         break;\r
812 \r
813                                 case IDCANCEL :\r
814 //                                      ExistMode = EXIST_ABORT;\r
815                                         EndDialog(hDlg, NO);\r
816                                         break;\r
817 \r
818                                 case IDHELP :\r
819                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000009);\r
820                                         break;\r
821                         }\r
822             return(TRUE);\r
823         }\r
824         return(FALSE);\r
825 }\r
826 \r
827 \r
828 \r
829 \r
830 \r
831 \r
832 /*----- \83t\83@\83C\83\8b\88ê\97\97\82Å\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82ð\83A\83b\83v\83\8d\81[\83h\82·\82é --------------------\r
833 *\r
834 *       Parameter\r
835 *               int ChName : \96¼\91O\82ð\95Ï\82¦\82é\82©\82Ç\82¤\82© (YES/NO)\r
836 *               int All : \91S\82Ä\82ª\91I\82Î\82ê\82Ä\82¢\82é\95¨\82Æ\82µ\82Ä\88µ\82¤\82©\82Ç\82¤\82© (YES/NO)\r
837 *\r
838 *       Return Value\r
839 *               \82È\82µ\r
840 *----------------------------------------------------------------------------*/\r
841 \r
842 void UpLoadListProc(int ChName, int All)\r
843 {\r
844         FILELIST *FileListBase;\r
845         FILELIST *Pos;\r
846         TRANSPACKET Pkt;\r
847         TRANSPACKET Pkt1;\r
848         char *Cat;\r
849         FILELIST *RemoteList;\r
850         char Tmp[FMAX_PATH+1];\r
851         int FirstAdd;\r
852 \r
853         if(CheckClosedAndReconnect() == SUCCESS)\r
854         {\r
855                 DisableUserOpe();\r
856 \r
857                 // \83\8d\81[\83J\83\8b\91¤\82Å\91I\82Î\82ê\82Ä\82¢\82é\83t\83@\83C\83\8b\82ðFileListBase\82É\93o\98^\r
858                 FileListBase = NULL;\r
859                 MakeSelectedFileList(WIN_LOCAL, YES, All, &FileListBase, &CancelFlg);\r
860 \r
861                 // \8c»\8dÝ\83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\82É\95\\8e¦\82³\82ê\82Ä\82¢\82é\82à\82Ì\82ðRemoteList\82É\93o\98^\r
862                 // \93¯\96¼\83t\83@\83C\83\8b\83`\83F\83b\83N\97p\r
863                 RemoteList = NULL;\r
864                 AddRemoteTreeToFileList(AskCurrentFileListNum(), "", RDIR_NONE, &RemoteList);\r
865 \r
866                 FirstAdd = YES;\r
867                 ExistNotify = YES;\r
868 \r
869                 Pos = FileListBase;\r
870                 while(Pos != NULL)\r
871                 {\r
872                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
873                         SetSlashTail(Pkt.RemoteFile);\r
874                         Cat = strchr(Pkt.RemoteFile, NUL);\r
875                         if((ChName == NO) || (Pos->Node == NODE_DIR))\r
876                         {\r
877                                 strcat(Pkt.RemoteFile, Pos->File);\r
878                                 if(FnameCnv == FNAME_LOWER)\r
879                                         _mbslwr(Cat);\r
880                                 else if(FnameCnv == FNAME_UPPER)\r
881                                         _mbsupr(Cat);\r
882                         }\r
883                         else\r
884                         {\r
885                                 // \96¼\91O\82ð\95Ï\8dX\82·\82é\r
886                                 strcpy(TmpString, Pos->File);\r
887                                 CurWin = WIN_LOCAL;\r
888                                 if(DialogBox(GetFtpInst(), MAKEINTRESOURCE(updown_as_dlg), GetMainHwnd(), UpDownAsDialogCallBack) == YES)\r
889                                         strcat(Pkt.RemoteFile, TmpString);\r
890                                 else\r
891                                         break;\r
892                         }\r
893                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
894 \r
895                         if(AskHostType() == HTYPE_ACOS)\r
896                         {\r
897                                 strcpy(Pkt.RemoteFile, "'");\r
898                                 strcat(Pkt.RemoteFile, AskHostLsName());\r
899                                 strcat(Pkt.RemoteFile, "(");\r
900                                 strcat(Pkt.RemoteFile, Cat);\r
901                                 strcat(Pkt.RemoteFile, ")");\r
902                                 strcat(Pkt.RemoteFile, "'");\r
903                         }\r
904                         else if(AskHostType() == HTYPE_ACOS_4)\r
905                                 strcpy(Pkt.RemoteFile, Cat);\r
906 \r
907                         if(Pos->Node == NODE_DIR)\r
908                         {\r
909                                 // \83t\83H\83\8b\83_\82Ì\8fê\8d\87\r
910 \r
911                                 // \83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\82ðRemoteList\82É\93o\98^\r
912                                 // \93¯\96¼\83t\83@\83C\83\8b\83`\83F\83b\83N\97p\r
913                                 if(RemoteList != NULL)\r
914                                         DeleteFileList(&RemoteList);\r
915                                 RemoteList = NULL;\r
916 \r
917                                 AskRemoteCurDir(Tmp, FMAX_PATH);\r
918                                 if(DoCWD(Pkt.RemoteFile, NO, NO, NO) == FTP_COMPLETE)\r
919                                 {\r
920                                         if(DoDirListCmdSkt("", "", 998, &CancelFlg) == FTP_COMPLETE)\r
921                                                 AddRemoteTreeToFileList(998, "", RDIR_NONE, &RemoteList);\r
922                                         DoCWD(Tmp, NO, NO, NO);\r
923                                 }\r
924                                 else\r
925                                 {\r
926                                         // \83t\83H\83\8b\83_\82ð\8dì\90¬\r
927                                         if((FirstAdd == YES) && (AskNoFullPathMode() == YES))\r
928                                         {\r
929                                                 strcpy(Pkt1.Cmd, "SETCUR");\r
930                                                 AskRemoteCurDir(Pkt1.RemoteFile, FMAX_PATH);\r
931                                                 AddTransFileList(&Pkt1);\r
932                                         }\r
933                                         FirstAdd = NO;\r
934                                         strcpy(Pkt.Cmd, "MKD ");\r
935                                         strcpy(Pkt.LocalFile, "");\r
936                                         AddTransFileList(&Pkt);\r
937                                 }\r
938                         }\r
939                         else if(Pos->Node == NODE_FILE)\r
940                         {\r
941                                 // \83t\83@\83C\83\8b\82Ì\8fê\8d\87\r
942                                 AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
943                                 SetYenTail(Pkt.LocalFile);\r
944                                 strcat(Pkt.LocalFile, Pos->File);\r
945                                 ReplaceAll(Pkt.LocalFile, '/', '\\');\r
946 \r
947                                 strcpy(Pkt.Cmd, "STOR ");\r
948                                 Pkt.Type = AskTransferTypeAssoc(Pkt.LocalFile, AskTransferType());\r
949                                 Pkt.Size = 0;\r
950                                 Pkt.Time = Pos->Time;\r
951                                 Pkt.Attr = AskUpLoadFileAttr(Pkt.RemoteFile);\r
952                                 Pkt.KanjiCode = AskHostKanjiCode();\r
953                                 // UTF-8\91Î\89\9e\r
954                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
955                                 Pkt.KanaCnv = AskHostKanaCnv();\r
956                                 Pkt.Mode = CheckRemoteFile(&Pkt, RemoteList);\r
957                                 if(Pkt.Mode == EXIST_ABORT)\r
958                                         break;\r
959                                 else if(Pkt.Mode != EXIST_IGNORE)\r
960                                 {\r
961                                         if((FirstAdd == YES) && (AskNoFullPathMode() == YES))\r
962                                         {\r
963                                                 strcpy(Pkt1.Cmd, "SETCUR");\r
964                                                 AskRemoteCurDir(Pkt1.RemoteFile, FMAX_PATH);\r
965                                                 AddTransFileList(&Pkt1);\r
966                                         }\r
967                                         FirstAdd = NO;\r
968                                         AddTransFileList(&Pkt);\r
969                                 }\r
970                         }\r
971                         Pos = Pos->Next;\r
972                 }\r
973 \r
974                 if((FirstAdd == NO) && (AskNoFullPathMode() == YES))\r
975                 {\r
976                         strcpy(Pkt.Cmd, "BACKCUR");\r
977                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
978                         AddTransFileList(&Pkt);\r
979                 }\r
980 \r
981                 if(RemoteList != NULL)\r
982                         DeleteFileList(&RemoteList);\r
983 \r
984                 DeleteFileList(&FileListBase);\r
985 \r
986                 strcpy(Pkt.Cmd, "GOQUIT");\r
987                 AddTransFileList(&Pkt);\r
988 \r
989                 GoForwardTransWindow();\r
990 \r
991                 EnableUserOpe();\r
992         }\r
993         return;\r
994 }\r
995 \r
996 \r
997 /*----- \83h\83\89\83b\83O\81\95\83h\83\8d\83b\83v\82Å\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82ð\83A\83b\83v\83\8d\81[\83h\82·\82é --------------\r
998 *\r
999 *       Parameter\r
1000 *               WPARAM wParam : \83h\83\8d\83b\83v\82³\82ê\82½\83t\83@\83C\83\8b\82Ì\8fî\95ñ\r
1001 *\r
1002 *       Return Value\r
1003 *               \82È\82µ\r
1004 *----------------------------------------------------------------------------*/\r
1005 \r
1006 void UpLoadDragProc(WPARAM wParam)\r
1007 {\r
1008         FILELIST *FileListBase;\r
1009         FILELIST *Pos;\r
1010         TRANSPACKET Pkt;\r
1011         TRANSPACKET Pkt1;\r
1012         char *Cat;\r
1013         FILELIST *RemoteList;\r
1014         char Tmp[FMAX_PATH+1];\r
1015         int FirstAdd;\r
1016         char Cur[FMAX_PATH+1];\r
1017 \r
1018         if(CheckClosedAndReconnect() == SUCCESS)\r
1019         {\r
1020                 DisableUserOpe();\r
1021 \r
1022                 // \83\8d\81[\83J\83\8b\91¤\82Å\91I\82Î\82ê\82Ä\82¢\82é\83t\83@\83C\83\8b\82ðFileListBase\82É\93o\98^\r
1023                 FileListBase = NULL;\r
1024                 MakeDroppedFileList(wParam, Cur, &FileListBase);\r
1025 \r
1026                 // \8c»\8dÝ\83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\82É\95\\8e¦\82³\82ê\82Ä\82¢\82é\82à\82Ì\82ðRemoteList\82É\93o\98^\r
1027                 // \93¯\96¼\83t\83@\83C\83\8b\83`\83F\83b\83N\97p\r
1028                 RemoteList = NULL;\r
1029                 AddRemoteTreeToFileList(AskCurrentFileListNum(), "", RDIR_NONE, &RemoteList);\r
1030 \r
1031                 FirstAdd = YES;\r
1032                 ExistNotify = YES;\r
1033 \r
1034                 Pos = FileListBase;\r
1035                 while(Pos != NULL)\r
1036                 {\r
1037                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1038                         SetSlashTail(Pkt.RemoteFile);\r
1039                         Cat = strchr(Pkt.RemoteFile, NUL);\r
1040 \r
1041                         strcat(Pkt.RemoteFile, Pos->File);\r
1042                         if(FnameCnv == FNAME_LOWER)\r
1043                                 _mbslwr(Cat);\r
1044                         else if(FnameCnv == FNAME_UPPER)\r
1045                                 _mbsupr(Cat);\r
1046                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
1047 \r
1048                         if(AskHostType() == HTYPE_ACOS)\r
1049                         {\r
1050                                 strcpy(Pkt.RemoteFile, "'");\r
1051                                 strcat(Pkt.RemoteFile, AskHostLsName());\r
1052                                 strcat(Pkt.RemoteFile, "(");\r
1053                                 strcat(Pkt.RemoteFile, Cat);\r
1054                                 strcat(Pkt.RemoteFile, ")");\r
1055                                 strcat(Pkt.RemoteFile, "'");\r
1056                         }\r
1057                         else if(AskHostType() == HTYPE_ACOS_4)\r
1058                                 strcpy(Pkt.RemoteFile, Cat);\r
1059 \r
1060                         if(Pos->Node == NODE_DIR)\r
1061                         {\r
1062                                 // \83t\83H\83\8b\83_\82Ì\8fê\8d\87\r
1063 \r
1064                                 // \83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\82ðRemoteList\82É\93o\98^\r
1065                                 // \93¯\96¼\83t\83@\83C\83\8b\83`\83F\83b\83N\97p\r
1066                                 if(RemoteList != NULL)\r
1067                                         DeleteFileList(&RemoteList);\r
1068                                 RemoteList = NULL;\r
1069 \r
1070                                 AskRemoteCurDir(Tmp, FMAX_PATH);\r
1071                                 if(DoCWD(Pkt.RemoteFile, NO, NO, NO) == FTP_COMPLETE)\r
1072                                 {\r
1073                                         if(DoDirListCmdSkt("", "", 998, &CancelFlg) == FTP_COMPLETE)\r
1074                                                 AddRemoteTreeToFileList(998, "", RDIR_NONE, &RemoteList);\r
1075                                         DoCWD(Tmp, NO, NO, NO);\r
1076                                 }\r
1077                                 else\r
1078                                 {\r
1079                                         if((FirstAdd == YES) && (AskNoFullPathMode() == YES))\r
1080                                         {\r
1081                                                 strcpy(Pkt1.Cmd, "SETCUR");\r
1082                                                 AskRemoteCurDir(Pkt1.RemoteFile, FMAX_PATH);\r
1083                                                 AddTransFileList(&Pkt1);\r
1084                                         }\r
1085                                         FirstAdd = NO;\r
1086                                         strcpy(Pkt.Cmd, "MKD ");\r
1087                                         strcpy(Pkt.LocalFile, "");\r
1088                                         AddTransFileList(&Pkt);\r
1089                                 }\r
1090                         }\r
1091                         else if(Pos->Node == NODE_FILE)\r
1092                         {\r
1093                                 // \83t\83@\83C\83\8b\82Ì\8fê\8d\87\r
1094                                 strcpy(Pkt.LocalFile, Cur);\r
1095                                 SetYenTail(Pkt.LocalFile);\r
1096                                 strcat(Pkt.LocalFile, Pos->File);\r
1097                                 ReplaceAll(Pkt.LocalFile, '/', '\\');\r
1098 \r
1099                                 strcpy(Pkt.Cmd, "STOR ");\r
1100                                 Pkt.Type = AskTransferTypeAssoc(Pkt.LocalFile, AskTransferType());\r
1101                                 Pkt.Size = 0;\r
1102                                 Pkt.Time = Pos->Time;\r
1103                                 Pkt.Attr = AskUpLoadFileAttr(Pkt.RemoteFile);\r
1104                                 Pkt.KanjiCode = AskHostKanjiCode();\r
1105                                 // UTF-8\91Î\89\9e\r
1106                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
1107                                 Pkt.KanaCnv = AskHostKanaCnv();\r
1108                                 Pkt.Mode = CheckRemoteFile(&Pkt, RemoteList);\r
1109                                 if(Pkt.Mode == EXIST_ABORT)\r
1110                                         break;\r
1111                                 else if(Pkt.Mode != EXIST_IGNORE)\r
1112                                 {\r
1113                                         if((FirstAdd == YES) && (AskNoFullPathMode() == YES))\r
1114                                         {\r
1115                                                 strcpy(Pkt1.Cmd, "SETCUR");\r
1116                                                 AskRemoteCurDir(Pkt1.RemoteFile, FMAX_PATH);\r
1117                                                 AddTransFileList(&Pkt1);\r
1118                                         }\r
1119                                         FirstAdd = NO;\r
1120                                         AddTransFileList(&Pkt);\r
1121                                 }\r
1122                         }\r
1123                         Pos = Pos->Next;\r
1124                 }\r
1125 \r
1126                 if((FirstAdd == NO) && (AskNoFullPathMode() == YES))\r
1127                 {\r
1128                         strcpy(Pkt.Cmd, "BACKCUR");\r
1129                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1130                         AddTransFileList(&Pkt);\r
1131                 }\r
1132 \r
1133                 if(RemoteList != NULL)\r
1134                         DeleteFileList(&RemoteList);\r
1135 \r
1136                 DeleteFileList(&FileListBase);\r
1137 \r
1138                 strcpy(Pkt.Cmd, "GOQUIT");\r
1139                 AddTransFileList(&Pkt);\r
1140 \r
1141                 GoForwardTransWindow();\r
1142 \r
1143                 EnableUserOpe();\r
1144         }\r
1145         return;\r
1146 }\r
1147 \r
1148 \r
1149 /*----- \83~\83\89\81[\83\8a\83\93\83O\83A\83b\83v\83\8d\81[\83h\82ð\8ds\82¤ ----------------------------------------\r
1150 *\r
1151 *       Parameter\r
1152 *               int Notify : \8am\94F\82ð\8ds\82¤\82©\82Ç\82¤\82© (YES/NO)\r
1153 *\r
1154 *       Return Value\r
1155 *               \82È\82µ\r
1156 *----------------------------------------------------------------------------*/\r
1157 \r
1158 void MirrorUploadProc(int Notify)\r
1159 {\r
1160         FILELIST *LocalListBase;\r
1161         FILELIST *RemoteListBase;\r
1162         FILELIST *LocalPos;\r
1163         FILELIST *RemotePos;\r
1164         TRANSPACKET Pkt;\r
1165         TRANSPACKET *Base;\r
1166         char Name[FMAX_PATH+1];\r
1167         char *Cat;\r
1168         int Level;\r
1169         int Mode;\r
1170         SYSTEMTIME TmpStime;\r
1171         FILETIME TmpFtimeL;\r
1172         FILETIME TmpFtimeR;\r
1173 \r
1174         if(CheckClosedAndReconnect() == SUCCESS)\r
1175         {\r
1176                 DisableUserOpe();\r
1177 \r
1178                 Base = NULL;\r
1179 \r
1180                 if(Notify == YES)\r
1181                         Notify = DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(mirror_up_dlg), GetMainHwnd(), MirrorNotifyCallBack, 1);\r
1182                 else\r
1183                         Notify = YES;\r
1184 \r
1185                 if((Notify == YES) || (Notify == YES_LIST))\r
1186                 {\r
1187                         /*===== \83t\83@\83C\83\8b\83\8a\83X\83g\8eæ\93¾ =====*/\r
1188 \r
1189                         LocalListBase = NULL;\r
1190                         MakeSelectedFileList(WIN_LOCAL, YES, YES, &LocalListBase, &CancelFlg);\r
1191                         RemoteListBase = NULL;\r
1192                         MakeSelectedFileList(WIN_REMOTE, YES, YES, &RemoteListBase, &CancelFlg);\r
1193 \r
1194                         LocalPos = LocalListBase;\r
1195                         while(LocalPos != NULL)\r
1196                         {\r
1197                                 LocalPos->Attr = YES;           /* LocalPos->Attr\82Í\93]\91\97\82·\82é\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O\82É\8eg\97p (YES/NO) */\r
1198                                 LocalPos = LocalPos->Next;\r
1199                         }\r
1200 \r
1201                         RemotePos = RemoteListBase;\r
1202                         while(RemotePos != NULL)\r
1203                         {\r
1204                                 if(AskMirrorNoTrn(RemotePos->File, 1) == NO)\r
1205                                 {\r
1206                                         RemotePos->Attr = YES;\r
1207                                         RemotePos = RemotePos->Next;\r
1208                                 }\r
1209                                 else\r
1210                                 {\r
1211                                         RemotePos->Attr = NO;   /* RemotePos->Attr\82Í\8dí\8f\9c\82·\82é\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O\82É\8eg\97p (YES/NO) */\r
1212 \r
1213                                         if(RemotePos->Node == NODE_DIR)\r
1214                                         {\r
1215                                                 Level = AskDirLevel(RemotePos->File);\r
1216                                                 RemotePos = RemotePos->Next;\r
1217                                                 while(RemotePos != NULL)\r
1218                                                 {\r
1219                                                         if((RemotePos->Node == NODE_DIR) &&\r
1220                                                            (AskDirLevel(RemotePos->File) <= Level))\r
1221                                                         {\r
1222                                                                 break;\r
1223                                                         }\r
1224                                                         RemotePos->Attr = NO;\r
1225                                                         RemotePos = RemotePos->Next;\r
1226                                                 }\r
1227                                         }\r
1228                                         else\r
1229                                                 RemotePos = RemotePos->Next;\r
1230                                 }\r
1231                         }\r
1232 \r
1233                         /*===== \83t\83@\83C\83\8b\83\8a\83X\83g\94ä\8ar =====*/\r
1234 \r
1235                         LocalPos = LocalListBase;\r
1236                         while(LocalPos != NULL)\r
1237                         {\r
1238                                 if(AskMirrorNoTrn(LocalPos->File, 0) == NO)\r
1239                                 {\r
1240                                         strcpy(Name, LocalPos->File);\r
1241                                         ReplaceAll(Name, '\\', '/');\r
1242 \r
1243                                         if(MirrorFnameCnv == YES)\r
1244                                                 Mode = COMP_LOWERMATCH;\r
1245                                         else\r
1246                                                 Mode = COMP_STRICT;\r
1247 \r
1248                                         if(LocalPos->Node == NODE_DIR)\r
1249                                         {\r
1250                                                 if((RemotePos = SearchFileList(Name, RemoteListBase, Mode)) != NULL)\r
1251                                                 {\r
1252                                                         if(RemotePos->Node == NODE_DIR)\r
1253                                                         {\r
1254                                                                 RemotePos->Attr = NO;\r
1255                                                                 LocalPos->Attr = NO;\r
1256                                                         }\r
1257                                                 }\r
1258                                         }\r
1259                                         else if(LocalPos->Node == NODE_FILE)\r
1260                                         {\r
1261                                                 if((RemotePos = SearchFileList(Name, RemoteListBase, Mode)) != NULL)\r
1262                                                 {\r
1263                                                         if(RemotePos->Node == NODE_FILE)\r
1264                                                         {\r
1265                                                                 FileTimeToLocalFileTime(&LocalPos->Time, &TmpFtimeL);\r
1266                                                                 FileTimeToLocalFileTime(&RemotePos->Time, &TmpFtimeR);\r
1267                                                                 if((RemotePos->InfoExist & FINFO_TIME) == 0)\r
1268                                                                 {\r
1269                                                                         FileTimeToSystemTime(&TmpFtimeL, &TmpStime);\r
1270                                                                         TmpStime.wHour = 0;\r
1271                                                                         TmpStime.wMinute = 0;\r
1272                                                                         TmpStime.wSecond = 0;\r
1273                                                                         TmpStime.wMilliseconds = 0;\r
1274                                                                         SystemTimeToFileTime(&TmpStime, &TmpFtimeL);\r
1275 \r
1276                                                                         FileTimeToSystemTime(&TmpFtimeR, &TmpStime);\r
1277                                                                         TmpStime.wHour = 0;\r
1278                                                                         TmpStime.wMinute = 0;\r
1279                                                                         TmpStime.wSecond = 0;\r
1280                                                                         TmpStime.wMilliseconds = 0;\r
1281                                                                         SystemTimeToFileTime(&TmpStime, &TmpFtimeR);\r
1282                                                                 }\r
1283                                                                 RemotePos->Attr = NO;\r
1284                                                                 if(CompareFileTime(&TmpFtimeL, &TmpFtimeR) <= 0)\r
1285                                                                         LocalPos->Attr = NO;\r
1286                                                         }\r
1287                                                 }\r
1288                                         }\r
1289 \r
1290                                         LocalPos = LocalPos->Next;\r
1291                                 }\r
1292                                 else\r
1293                                 {\r
1294                                         if(LocalPos->Node == NODE_FILE)\r
1295                                         {\r
1296                                                 LocalPos->Attr = NO;\r
1297                                                 LocalPos = LocalPos->Next;\r
1298                                         }\r
1299                                         else\r
1300                                         {\r
1301                                                 LocalPos->Attr = NO;\r
1302                                                 Level = AskDirLevel(LocalPos->File);\r
1303                                                 LocalPos = LocalPos->Next;\r
1304                                                 while(LocalPos != NULL)\r
1305                                                 {\r
1306                                                         if((LocalPos->Node == NODE_DIR) &&\r
1307                                                            (AskDirLevel(LocalPos->File) <= Level))\r
1308                                                         {\r
1309                                                                 break;\r
1310                                                         }\r
1311                                                         LocalPos->Attr = NO;\r
1312                                                         LocalPos = LocalPos->Next;\r
1313                                                 }\r
1314                                         }\r
1315                                 }\r
1316                         }\r
1317 \r
1318                         DispMirrorFiles(LocalListBase, RemoteListBase);\r
1319 \r
1320                         /*===== \8dí\8f\9c\81^\83A\83b\83v\83\8d\81[\83h =====*/\r
1321 \r
1322                         RemotePos = RemoteListBase;\r
1323                         while(RemotePos != NULL)\r
1324                         {\r
1325                                 if((RemotePos->Attr == YES) && (RemotePos->Node == NODE_FILE))\r
1326                                 {\r
1327                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1328                                         SetSlashTail(Pkt.RemoteFile);\r
1329                                         strcat(Pkt.RemoteFile, RemotePos->File);\r
1330                                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
1331                                         strcpy(Pkt.LocalFile, "");\r
1332                                         strcpy(Pkt.Cmd, "R-DELE ");\r
1333                                         AddTmpTransFileList(&Pkt, &Base);\r
1334                                 }\r
1335                                 RemotePos = RemotePos->Next;\r
1336                         }\r
1337                         MirrorDeleteAllDir(RemoteListBase, &Pkt, &Base);\r
1338 \r
1339                         LocalPos = LocalListBase;\r
1340                         while(LocalPos != NULL)\r
1341                         {\r
1342                                 if(LocalPos->Attr == YES)\r
1343                                 {\r
1344                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1345                                         SetSlashTail(Pkt.RemoteFile);\r
1346                                         Cat = strchr(Pkt.RemoteFile, NUL);\r
1347                                         strcat(Pkt.RemoteFile, LocalPos->File);\r
1348 \r
1349                                         if(MirrorFnameCnv == YES)\r
1350                                                 _mbslwr(Cat);\r
1351 \r
1352                                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
1353 \r
1354                                         if(LocalPos->Node == NODE_DIR)\r
1355                                         {\r
1356                                                 strcpy(Pkt.LocalFile, "");\r
1357                                                 strcpy(Pkt.Cmd, "R-MKD ");\r
1358                                                 AddTmpTransFileList(&Pkt, &Base);\r
1359                                         }\r
1360                                         else if(LocalPos->Node == NODE_FILE)\r
1361                                         {\r
1362                                                 AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
1363                                                 SetYenTail(Pkt.LocalFile);\r
1364                                                 strcat(Pkt.LocalFile, LocalPos->File);\r
1365                                                 ReplaceAll(Pkt.LocalFile, '/', '\\');\r
1366 \r
1367                                                 strcpy(Pkt.Cmd, "STOR ");\r
1368                                                 Pkt.Type = AskTransferTypeAssoc(Pkt.LocalFile, AskTransferType());\r
1369                                                 Pkt.Size = 0;\r
1370                                                 Pkt.Time = LocalPos->Time;\r
1371                                                 Pkt.Attr = AskUpLoadFileAttr(Pkt.RemoteFile);\r
1372                                                 Pkt.KanjiCode = AskHostKanjiCode();\r
1373                                                 // UTF-8\91Î\89\9e\r
1374                                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
1375                                                 Pkt.KanaCnv = AskHostKanaCnv();\r
1376                                                 Pkt.Mode = EXIST_OVW;\r
1377                                                 AddTmpTransFileList(&Pkt, &Base);\r
1378                                         }\r
1379                                 }\r
1380                                 LocalPos = LocalPos->Next;\r
1381                         }\r
1382 \r
1383                         if((Notify == YES) ||\r
1384                            (DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(mirror_notify_dlg), GetMainHwnd(), MirrorDispListCallBack, (LPARAM)&Base) == YES))\r
1385                         {\r
1386                                 if(AskNoFullPathMode() == YES)\r
1387                                 {\r
1388                                         strcpy(Pkt.Cmd, "SETCUR");\r
1389                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1390                                         AddTransFileList(&Pkt);\r
1391                                 }\r
1392                                 AppendTransFileList(Base);\r
1393 \r
1394                                 if(AskNoFullPathMode() == YES)\r
1395                                 {\r
1396                                         strcpy(Pkt.Cmd, "BACKCUR");\r
1397                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1398                                         AddTransFileList(&Pkt);\r
1399                                 }\r
1400 \r
1401                                 strcpy(Pkt.Cmd, "GOQUIT");\r
1402                                 AddTransFileList(&Pkt);\r
1403                         }\r
1404                         else\r
1405                                 EraseTmpTransFileList(&Base);\r
1406 \r
1407                         DeleteFileList(&LocalListBase);\r
1408                         DeleteFileList(&RemoteListBase);\r
1409 \r
1410                         GoForwardTransWindow();\r
1411                 }\r
1412 \r
1413                 EnableUserOpe();\r
1414         }\r
1415         return;\r
1416 }\r
1417 \r
1418 \r
1419 /*----- \83~\83\89\81[\83\8a\83\93\83O\8e\9e\82Ì\83z\83X\83g\91¤\82Ì\83t\83H\83\8b\83_\8dí\8f\9c --------------------------------\r
1420 *\r
1421 *       Parameter\r
1422 *               FILELIST *Base : \83t\83@\83C\83\8b\83\8a\83X\83g\r
1423 *               TRANSPACKET *Pkt : \r
1424 *               TRANSPACKET **Base : \r
1425 *\r
1426 *       Return Value\r
1427 *               \82È\82µ\r
1428 *----------------------------------------------------------------------------*/\r
1429 \r
1430 static void MirrorDeleteAllDir(FILELIST *Remote, TRANSPACKET *Pkt, TRANSPACKET **Base)\r
1431 {\r
1432         while(Remote != NULL)\r
1433         {\r
1434                 if(Remote->Node == NODE_DIR)\r
1435                 {\r
1436                         MirrorDeleteAllDir(Remote->Next, Pkt, Base);\r
1437 \r
1438                         if(Remote->Attr == YES)\r
1439                         {\r
1440                                 AskRemoteCurDir(Pkt->RemoteFile, FMAX_PATH);\r
1441                                 SetSlashTail(Pkt->RemoteFile);\r
1442                                 strcat(Pkt->RemoteFile, Remote->File);\r
1443                                 ReplaceAll(Pkt->RemoteFile, '\\', '/');\r
1444                                 strcpy(Pkt->LocalFile, "");\r
1445                                 strcpy(Pkt->Cmd, "R-RMD ");\r
1446                                 AddTmpTransFileList(Pkt, Base);\r
1447                         }\r
1448                         break;\r
1449                 }\r
1450                 Remote = Remote->Next;\r
1451         }\r
1452         return;\r
1453 }\r
1454 \r
1455 \r
1456 /*----- \83~\83\89\81[\83\8a\83\93\83O\83A\83b\83v\83\8d\81[\83h\8aJ\8en\8am\94F\83E\83C\83\93\83h\83E\82Ì\83R\81[\83\8b\83o\83b\83N --------------\r
1457 *\r
1458 *       Parameter\r
1459 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
1460 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
1461 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
1462 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
1463 *\r
1464 *       Return Value\r
1465 *               BOOL TRUE/FALSE\r
1466 *----------------------------------------------------------------------------*/\r
1467 \r
1468 static BOOL CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
1469 {\r
1470         static int Mode;\r
1471 \r
1472         switch (iMessage)\r
1473         {\r
1474                 case WM_INITDIALOG :\r
1475                         Mode = lParam;\r
1476                         return(TRUE);\r
1477 \r
1478                 case WM_COMMAND :\r
1479                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1480                         {\r
1481                                 case IDOK :\r
1482                                         EndDialog(hDlg, YES);\r
1483                                         break;\r
1484 \r
1485                                 case IDCANCEL :\r
1486                                         EndDialog(hDlg, NO);\r
1487                                         break;\r
1488 \r
1489                                 case MIRRORUP_DISP :\r
1490                                         EndDialog(hDlg, YES_LIST);\r
1491                                         break;\r
1492 \r
1493                                 case IDHELP :\r
1494                                         if(Mode == 0)\r
1495                                                 hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000013);\r
1496                                         else\r
1497                                                 hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000012);\r
1498                         }\r
1499             return(TRUE);\r
1500         }\r
1501         return(FALSE);\r
1502 }\r
1503 \r
1504 \r
1505 /*----- \83~\83\89\81[\83\8a\83\93\83O\83A\83b\83v\83\8d\81[\83h\8f\88\97\9d\93à\97e\8am\94F\83E\83C\83\93\83h\83E\82Ì\83R\81[\83\8b\83o\83b\83N ----------\r
1506 *\r
1507 *       Parameter\r
1508 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
1509 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
1510 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
1511 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
1512 *\r
1513 *       Return Value\r
1514 *               BOOL TRUE/FALSE\r
1515 *----------------------------------------------------------------------------*/\r
1516 \r
1517 static BOOL CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
1518 {\r
1519         static DIALOGSIZE DlgSize = {\r
1520                 { MIRROR_DEL, MIRROR_SIZEGRIP, -1 },\r
1521                 { IDOK, IDCANCEL, IDHELP, MIRROR_DEL, MIRROR_COPYNUM, MIRROR_MAKENUM, MIRROR_DELNUM, MIRROR_SIZEGRIP, -1 },\r
1522                 { MIRROR_LIST, -1 },\r
1523                 { 0, 0 },\r
1524                 { 0, 0 }\r
1525         };\r
1526 \r
1527         static TRANSPACKET **Base;\r
1528         TRANSPACKET *Pos;\r
1529         char Tmp[FMAX_PATH+1+6];\r
1530         int Num;\r
1531         int *List;\r
1532 \r
1533         switch (iMessage)\r
1534         {\r
1535                 case WM_INITDIALOG :\r
1536                         Base = (TRANSPACKET **)lParam;\r
1537                         Pos = *Base;\r
1538                         while(Pos != NULL)\r
1539                         {\r
1540                                 strcpy(Tmp, "");\r
1541                                 if((strncmp(Pos->Cmd, "R-DELE", 6) == 0) ||\r
1542                                    (strncmp(Pos->Cmd, "R-RMD", 5) == 0))\r
1543                                         sprintf(Tmp, MSGJPN052, Pos->RemoteFile);\r
1544                                 else if(strncmp(Pos->Cmd, "R-MKD", 5) == 0)\r
1545                                         sprintf(Tmp, MSGJPN053, Pos->RemoteFile);\r
1546                                 else if(strncmp(Pos->Cmd, "STOR", 4) == 0)\r
1547                                         sprintf(Tmp, MSGJPN054, Pos->RemoteFile);\r
1548                                 else if((strncmp(Pos->Cmd, "L-DELE", 6) == 0) ||\r
1549                                                 (strncmp(Pos->Cmd, "L-RMD", 5) == 0))\r
1550                                         sprintf(Tmp, MSGJPN055, Pos->LocalFile);\r
1551                                 else if(strncmp(Pos->Cmd, "L-MKD", 5) == 0)\r
1552                                         sprintf(Tmp, MSGJPN056, Pos->LocalFile);\r
1553                                 else if(strncmp(Pos->Cmd, "RETR", 4) == 0)\r
1554                                         sprintf(Tmp, MSGJPN057, Pos->LocalFile);\r
1555 \r
1556                                 if(strlen(Tmp) > 0)\r
1557                                         SendDlgItemMessage(hDlg, MIRROR_LIST, LB_ADDSTRING, 0, (LPARAM)Tmp);\r
1558                                 Pos = Pos->Next;\r
1559                         }\r
1560                         CountMirrorFiles(hDlg, *Base);\r
1561                         DlgSizeInit(hDlg, &DlgSize, &MirrorDlgSize);\r
1562                         EnableWindow(GetDlgItem(hDlg, MIRROR_DEL), FALSE);\r
1563                         return(TRUE);\r
1564 \r
1565                 case WM_COMMAND :\r
1566                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1567                         {\r
1568                                 case IDOK :\r
1569                                         AskDlgSize(hDlg, &DlgSize, &MirrorDlgSize);\r
1570                                         EndDialog(hDlg, YES);\r
1571                                         break;\r
1572 \r
1573                                 case IDCANCEL :\r
1574                                         AskDlgSize(hDlg, &DlgSize, &MirrorDlgSize);\r
1575                                         EndDialog(hDlg, NO);\r
1576                                         break;\r
1577 \r
1578                                 case MIRROR_DEL :\r
1579                                         Num = SendDlgItemMessage(hDlg, MIRROR_LIST, LB_GETSELCOUNT, 0, 0);\r
1580                                         if((List = malloc(Num * sizeof(int))) != NULL)\r
1581                                         {\r
1582                                                 Num = SendDlgItemMessage(hDlg, MIRROR_LIST, LB_GETSELITEMS, Num, (LPARAM)List);\r
1583                                                 for(Num--; Num >= 0; Num--)\r
1584                                                 {\r
1585                                                         if(RemoveTmpTransFileListItem(Base, List[Num]) == SUCCESS)\r
1586                                                                 SendDlgItemMessage(hDlg, MIRROR_LIST, LB_DELETESTRING, List[Num], 0);\r
1587                                                         else\r
1588                                                                 MessageBeep(-1);\r
1589                                                 }\r
1590                                                 free(List);\r
1591                                                 CountMirrorFiles(hDlg, *Base);\r
1592                                         }\r
1593                                         break;\r
1594 \r
1595                                 case MIRROR_LIST :\r
1596                                         switch(GET_WM_COMMAND_CMD(wParam, lParam))\r
1597                                         {\r
1598                                                 case LBN_SELCHANGE :\r
1599                                                         if(SendDlgItemMessage(hDlg, MIRROR_LIST, LB_GETSELCOUNT, 0, 0) > 0)\r
1600                                                                 EnableWindow(GetDlgItem(hDlg, MIRROR_DEL), TRUE);\r
1601                                                         else\r
1602                                                                 EnableWindow(GetDlgItem(hDlg, MIRROR_DEL), FALSE);\r
1603                                                         break;\r
1604                                         }\r
1605                                         break;\r
1606 \r
1607                                 case IDHELP :\r
1608                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000012);\r
1609                         }\r
1610             return(TRUE);\r
1611 \r
1612                 case WM_SIZING :\r
1613                         DlgSizeChange(hDlg, &DlgSize, (RECT *)lParam, (int)wParam);\r
1614                     return(TRUE);\r
1615         }\r
1616         return(FALSE);\r
1617 }\r
1618 \r
1619 \r
1620 /*----- \83~\83\89\81[\83\8a\83\93\83O\82Å\93]\91\97\81^\8dí\8f\9c\82·\82é\83t\83@\83C\83\8b\82Ì\90\94\82ð\90\94\82¦\83_\83C\83A\83\8d\83O\82É\95\\8e¦---------\r
1621 *\r
1622 *       Parameter\r
1623 *               HWND hWnd : \r
1624 *               TRANSPACKET *Pkt : \r
1625 *\r
1626 *       Return Value\r
1627 *               \82È\82µ\r
1628 *----------------------------------------------------------------------------*/\r
1629 \r
1630 static void CountMirrorFiles(HWND hDlg, TRANSPACKET *Pkt)\r
1631 {\r
1632         char Tmp[80];\r
1633         int Del;\r
1634         int Make;\r
1635         int Copy;\r
1636 \r
1637         Del = 0;\r
1638         Make = 0;\r
1639         Copy = 0;\r
1640         while(Pkt != NULL)\r
1641         {\r
1642                 if((strncmp(Pkt->Cmd, "R-DELE", 6) == 0) ||\r
1643                    (strncmp(Pkt->Cmd, "R-RMD", 5) == 0) ||\r
1644                    (strncmp(Pkt->Cmd, "L-DELE", 6) == 0) ||\r
1645                    (strncmp(Pkt->Cmd, "L-RMD", 5) == 0))\r
1646                 {\r
1647                         Del += 1;\r
1648                 }\r
1649                 else if((strncmp(Pkt->Cmd, "R-MKD", 5) == 0) ||\r
1650                                 (strncmp(Pkt->Cmd, "L-MKD", 5) == 0))\r
1651                 {\r
1652                         Make += 1;\r
1653                 }\r
1654                 else if((strncmp(Pkt->Cmd, "STOR", 4) == 0) ||\r
1655                                 (strncmp(Pkt->Cmd, "RETR", 4) == 0))\r
1656                 {\r
1657                         Copy += 1;\r
1658                 }\r
1659                 Pkt = Pkt->Next;\r
1660         }\r
1661 \r
1662         if(Copy != 0)\r
1663                 sprintf(Tmp, MSGJPN058, Copy);\r
1664         else\r
1665                 sprintf(Tmp, MSGJPN059);\r
1666         SendDlgItemMessage(hDlg, MIRROR_COPYNUM, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1667 \r
1668         if(Make != 0)\r
1669                 sprintf(Tmp, MSGJPN060, Make);\r
1670         else\r
1671                 sprintf(Tmp, MSGJPN061);\r
1672         SendDlgItemMessage(hDlg, MIRROR_MAKENUM, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1673 \r
1674         if(Del != 0)\r
1675                 sprintf(Tmp, MSGJPN062, Del);\r
1676         else\r
1677                 sprintf(Tmp, MSGJPN063);\r
1678         SendDlgItemMessage(hDlg, MIRROR_DELNUM, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1679 \r
1680         return;\r
1681 }\r
1682 \r
1683 \r
1684 \r
1685 \r
1686 /*----- \83~\83\89\81[\83\8a\83\93\83O\82Å\93]\91\97\81^\8dí\8f\9c\82µ\82È\82¢\83t\83@\83C\83\8b\82©\82Ç\82¤\82©\82ð\95Ô\82· ------------------\r
1687 *\r
1688 *       Parameter\r
1689 *               char Fname : \83t\83@\83C\83\8b\96¼\r
1690 *               int Mode : \83\82\81[\83h\r
1691 *                       0=\93]\91\97\82µ\82È\82¢\83t\83@\83C\83\8b, 1=\8dí\8f\9c\82µ\82È\82¢\83t\83@\83C\83\8b\r
1692 *\r
1693 *       Return Value\r
1694 *               int \83X\83e\81[\83^\83X\r
1695 *                       YES=\93]\91\97\81E\8dí\8f\9c\82µ\82È\82¢/NO\r
1696 *----------------------------------------------------------------------------*/\r
1697 \r
1698 static int AskMirrorNoTrn(char *Fname, int Mode)\r
1699 {\r
1700         int Ret;\r
1701         char *Tbl;\r
1702 \r
1703         Tbl = MirrorNoTrn;\r
1704         if(Mode == 1)\r
1705                 Tbl = MirrorNoDel;\r
1706 \r
1707         Ret = NO;\r
1708         if(StrMultiLen(Tbl) > 0)\r
1709         {\r
1710                 Fname = GetFileName(Fname);\r
1711                 while(*Tbl != NUL)\r
1712                 {\r
1713                         if(CheckFname(Fname, Tbl) == SUCCESS)\r
1714                         {\r
1715                                 Ret = YES;\r
1716                                 break;\r
1717                         }\r
1718                         Tbl += strlen(Tbl) + 1;\r
1719                 }\r
1720         }\r
1721         return(Ret);\r
1722 }\r
1723 \r
1724 \r
1725 /*----- \83A\83b\83v\83\8d\81[\83h\82·\82é\83t\83@\83C\83\8b\82Ì\91®\90«\82ð\95Ô\82· ----------------------------------\r
1726 *\r
1727 *       Parameter\r
1728 *               char Fname : \83t\83@\83C\83\8b\96¼\r
1729 *\r
1730 *       Return Value\r
1731 *               int \91®\90« (-1=\90Ý\92è\82È\82µ)\r
1732 *----------------------------------------------------------------------------*/\r
1733 \r
1734 static int AskUpLoadFileAttr(char *Fname)\r
1735 {\r
1736         int Ret;\r
1737         int Sts;\r
1738         char *Tbl;\r
1739 \r
1740         Tbl = DefAttrList;\r
1741         Fname = GetFileName(Fname);\r
1742         Ret = -1;\r
1743         while(*Tbl != NUL)\r
1744         {\r
1745                 Sts = CheckFname(Fname, Tbl);\r
1746                 Tbl += strlen(Tbl) + 1;\r
1747 \r
1748                 if((Sts == SUCCESS) && (*Tbl != NUL))\r
1749                 {\r
1750                         Ret = xtoi(Tbl);\r
1751                         break;\r
1752                 }\r
1753                 Tbl += strlen(Tbl) + 1;\r
1754         }\r
1755         return(Ret);\r
1756 }\r
1757 \r
1758 \r
1759 /*----- \83z\83X\83g\82É\93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82È\82¢\82©\83`\83F\83b\83N- ---------------------------a\r
1760 *\r
1761 *       Parameter\r
1762 *               TRANSPACKET *Pkt : \93]\91\97\83t\83@\83C\83\8b\8fî\95ñ\r
1763 *               FILELIST *ListList : \r
1764 *\r
1765 *       Return Value\r
1766 *               int \8f\88\97\9d\95û\96@\r
1767 *                       EXIST_OVW/EXIST_UNIQUE/EXIST_IGNORE\r
1768 *\r
1769 *       Note\r
1770 *               Pkt.ExistSize, UpExistMode\81AExistNotify \82ª\95Ï\8dX\82³\82ê\82é\r
1771 *----------------------------------------------------------------------------*/\r
1772 \r
1773 static int CheckRemoteFile(TRANSPACKET *Pkt, FILELIST *ListList)\r
1774 {\r
1775         int Ret;\r
1776         FILELIST *Exist;\r
1777 \r
1778         Ret = EXIST_OVW;\r
1779         Pkt->ExistSize = 0;\r
1780         if(SendMode != TRANS_OVW)\r
1781         {\r
1782                 if((Exist = SearchFileList(GetFileName(Pkt->RemoteFile), ListList, COMP_STRICT)) != NULL)\r
1783                 {\r
1784                         Pkt->ExistSize = Exist->Size;\r
1785 \r
1786                         if(ExistNotify == YES)\r
1787                         {\r
1788                                 SoundPlay(SND_ERROR);\r
1789                                 if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(up_exist_dlg), GetMainHwnd(), UpExistDialogCallBack, (LPARAM)Pkt) == NO)\r
1790                                         Ret = EXIST_ABORT;\r
1791                                 else\r
1792                                         Ret = UpExistMode;\r
1793                         }\r
1794                         else\r
1795                                 Ret = UpExistMode;\r
1796 \r
1797                         if(Ret == EXIST_NEW)\r
1798                         {\r
1799                                 /*\83t\83@\83C\83\8b\93ú\95t\83`\83F\83b\83N */\r
1800                                 if(CompareFileTime(&Exist->Time, &Pkt->Time) < 0)\r
1801                                         Ret = EXIST_OVW;\r
1802                                 else\r
1803                                         Ret = EXIST_IGNORE;\r
1804                         }\r
1805                 }\r
1806         }\r
1807         return(Ret);\r
1808 }\r
1809 \r
1810 \r
1811 /*----- \83z\83X\83g\82É\93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82 \82é\8e\9e\82Ì\8am\94F\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ------\r
1812 *\r
1813 *       Parameter\r
1814 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
1815 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
1816 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
1817 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
1818 *\r
1819 *       Return Value\r
1820 *               BOOL TRUE/FALSE\r
1821 *----------------------------------------------------------------------------*/\r
1822 \r
1823 static BOOL CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
1824 {\r
1825         static TRANSPACKET *Pkt;\r
1826         static const RADIOBUTTON UpExistButton[] = {\r
1827                 { UP_EXIST_OVW, EXIST_OVW },\r
1828                 { UP_EXIST_NEW, EXIST_NEW },\r
1829                 { UP_EXIST_RESUME, EXIST_RESUME },\r
1830                 { UP_EXIST_UNIQUE, EXIST_UNIQUE },\r
1831                 { UP_EXIST_IGNORE, EXIST_IGNORE }\r
1832         };\r
1833         #define UPEXISTBUTTONS  (sizeof(UpExistButton)/sizeof(RADIOBUTTON))\r
1834 \r
1835         switch (iMessage)\r
1836         {\r
1837                 case WM_INITDIALOG :\r
1838                         Pkt = (TRANSPACKET *)lParam;\r
1839                         SendDlgItemMessage(hDlg, UP_EXIST_NAME, EM_LIMITTEXT, FMAX_PATH, 0);\r
1840                         SendDlgItemMessage(hDlg, UP_EXIST_NAME, WM_SETTEXT, 0, (LPARAM)Pkt->RemoteFile);\r
1841 \r
1842                         if((Pkt->Type == TYPE_A) || (Pkt->ExistSize <= 0))\r
1843                                 EnableWindow(GetDlgItem(hDlg, UP_EXIST_RESUME), FALSE);\r
1844 \r
1845                         SetRadioButtonByValue(hDlg, UpExistMode, UpExistButton, UPEXISTBUTTONS);\r
1846                         return(TRUE);\r
1847 \r
1848                 case WM_COMMAND :\r
1849                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1850                         {\r
1851                                 case IDOK_ALL :\r
1852                                         ExistNotify = NO;\r
1853                                         /* \82±\82±\82É break \82Í\82È\82¢ */\r
1854 \r
1855                                 case IDOK :\r
1856                                         UpExistMode = AskRadioButtonValue(hDlg, UpExistButton, UPEXISTBUTTONS);\r
1857                                         SendDlgItemMessage(hDlg, UP_EXIST_NAME, WM_GETTEXT, FMAX_PATH, (LPARAM)Pkt->RemoteFile);\r
1858                                         EndDialog(hDlg, YES);\r
1859                                         break;\r
1860 \r
1861                                 case IDCANCEL :\r
1862 //                                      Pkt->Abort = ABORT_USER;\r
1863 //                                      UpExistMode = EXIST_IGNORE;\r
1864                                         EndDialog(hDlg, NO);\r
1865                                         break;\r
1866 \r
1867                                 case IDHELP :\r
1868                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000011);\r
1869                                         break;\r
1870                         }\r
1871             return(TRUE);\r
1872         }\r
1873         return(FALSE);\r
1874 }\r
1875 \r
1876 \r
1877 /*----- \83A\83b\83v\83\8d\81[\83h\81^\83_\83E\83\93\83\8d\81[\83h\83t\83@\83C\83\8b\96¼\93ü\97Í\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ------\r
1878 *\r
1879 *       Parameter\r
1880 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
1881 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
1882 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
1883 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
1884 *\r
1885 *       Return Value\r
1886 *               BOOL TRUE/FALSE\r
1887 *----------------------------------------------------------------------------*/\r
1888 \r
1889 static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
1890 {\r
1891         switch (iMessage)\r
1892         {\r
1893                 case WM_INITDIALOG :\r
1894                         if(CurWin == WIN_LOCAL)\r
1895                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN064);\r
1896                         else\r
1897                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN065);\r
1898 \r
1899                         SendDlgItemMessage(hDlg, UPDOWNAS_NEW, EM_LIMITTEXT, FMAX_PATH, 0);\r
1900                         SendDlgItemMessage(hDlg, UPDOWNAS_NEW, WM_SETTEXT, 0, (LPARAM)TmpString);\r
1901                         SendDlgItemMessage(hDlg, UPDOWNAS_TEXT, WM_SETTEXT, 0, (LPARAM)TmpString);\r
1902                         return(TRUE);\r
1903 \r
1904                 case WM_COMMAND :\r
1905                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1906                         {\r
1907                                 case IDOK :\r
1908                                         SendDlgItemMessage(hDlg, UPDOWNAS_NEW, WM_GETTEXT, FMAX_PATH, (LPARAM)TmpString);\r
1909                                         EndDialog(hDlg, YES);\r
1910                                         break;\r
1911 \r
1912                                 case UPDOWNAS_STOP :\r
1913                                         EndDialog(hDlg, NO_ALL);\r
1914                                         break;\r
1915                         }\r
1916             return(TRUE);\r
1917         }\r
1918         return(FALSE);\r
1919 }\r
1920 \r
1921 \r
1922 /*----- \83t\83@\83C\83\8b\88ê\97\97\82Å\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82ð\8dí\8f\9c\82·\82é ----------------------------\r
1923 *\r
1924 *       Parameter\r
1925 *               \82È\82µ\r
1926 *\r
1927 *       Return Value\r
1928 *               \82È\82µ\r
1929 *----------------------------------------------------------------------------*/\r
1930 \r
1931 void DeleteProc(void)\r
1932 {\r
1933         int Win;\r
1934         FILELIST *FileListBase;\r
1935         FILELIST *Pos;\r
1936         int DelFlg;\r
1937         int Sts;\r
1938         char CurDir[FMAX_PATH+1];\r
1939         char Tmp[FMAX_PATH+1];\r
1940 \r
1941         Sts = YES;\r
1942         AskRemoteCurDir(CurDir, FMAX_PATH);\r
1943         FileListBase = NULL;\r
1944         if(GetFocus() == GetLocalHwnd())\r
1945         {\r
1946                 Win = WIN_LOCAL;\r
1947                 MakeSelectedFileList(Win, NO, NO, &FileListBase, &CancelFlg);\r
1948         }\r
1949         else\r
1950         {\r
1951                 Win = WIN_REMOTE;\r
1952                 if(CheckClosedAndReconnect() == SUCCESS)\r
1953                         MakeSelectedFileList(Win, YES, NO, &FileListBase, &CancelFlg);\r
1954                 else\r
1955                         Sts = NO;\r
1956         }\r
1957 \r
1958         if(Sts == YES)\r
1959         {\r
1960                 DisableUserOpe();\r
1961 \r
1962                 DelFlg = NO;\r
1963                 Sts = NO;\r
1964                 Pos = FileListBase;\r
1965                 while(Pos != NULL)\r
1966                 {\r
1967                         if(Pos->Node == NODE_FILE)\r
1968                         {\r
1969                                 DelNotifyAndDo(Pos, Win, &Sts, &DelFlg, CurDir);\r
1970                                 if(Sts == NO_ALL)\r
1971                                         break;\r
1972                         }\r
1973                         Pos = Pos->Next;\r
1974                 }\r
1975 \r
1976                 if(Sts != NO_ALL)\r
1977                         DeleteAllDir(FileListBase, Win, &Sts, &DelFlg, CurDir);\r
1978 \r
1979                 if(Win == WIN_REMOTE)\r
1980                 {\r
1981                         AskRemoteCurDir(Tmp, FMAX_PATH);\r
1982                         if(strcmp(Tmp, CurDir) != 0)\r
1983                                 DoCWD(Tmp, NO, NO, NO);\r
1984                 }\r
1985 \r
1986                 DeleteFileList(&FileListBase);\r
1987 \r
1988                 if(DelFlg == YES)\r
1989                 {\r
1990                         if(Win == WIN_LOCAL)\r
1991                                 GetLocalDirForWnd();\r
1992                         else\r
1993                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
1994                 }\r
1995 \r
1996                 EnableUserOpe();\r
1997         }\r
1998         return;\r
1999 }\r
2000 \r
2001 \r
2002 /*----- \83T\83u\83f\83B\83\8c\83N\83g\83\8a\88È\89º\82ð\91S\82Ä\8dí\8f\9c\82·\82é ------------------------------------\r
2003 *\r
2004 *       Parameter\r
2005 *               FILELIST *Dt : \8dí\8f\9c\82·\82é\83t\83@\83C\83\8b\82Ì\83\8a\83X\83g\r
2006 *               int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
2007 *               int *Sw : \91\80\8dì\95û\96@ (YES/NO/YES_ALL/NO_ALL)\r
2008 *               int *Flg : \83t\83@\83C\83\8b\82ð\8dí\8f\9c\82µ\82½\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O (YES/NO)\r
2009 *               char *CurDir : \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\r
2010 *\r
2011 *       Return Value\r
2012 *               \82È\82µ\r
2013 *----------------------------------------------------------------------------*/\r
2014 \r
2015 static void DeleteAllDir(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDir)\r
2016 {\r
2017         while(Dt != NULL)\r
2018         {\r
2019                 if(Dt->Node == NODE_DIR)\r
2020                 {\r
2021                         DeleteAllDir(Dt->Next, Win, Sw, Flg, CurDir);\r
2022                         if(*Sw == NO_ALL)\r
2023                                 break;\r
2024 \r
2025                         DelNotifyAndDo(Dt, Win, Sw, Flg, CurDir);\r
2026                         break;\r
2027                 }\r
2028                 Dt = Dt->Next;\r
2029         }\r
2030         return;\r
2031 }\r
2032 \r
2033 \r
2034 /*----- \8dí\8f\9c\82·\82é\82©\82Ç\82¤\82©\82Ì\8am\94F\82Æ\8dí\8f\9c\8eÀ\8ds --------------------------------------\r
2035 *\r
2036 *       Parameter\r
2037 *               FILELIST *Dt : \8dí\8f\9c\82·\82é\83t\83@\83C\83\8b\82Ì\83\8a\83X\83g\r
2038 *               int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
2039 *               int *Sw : \91\80\8dì\95û\96@ (YES/NO/YES_ALL/NO_ALL)\r
2040 *               int *Flg : \83t\83@\83C\83\8b\82ð\8dí\8f\9c\82µ\82½\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O (YES/NO)\r
2041 *               char *CurDir : \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\r
2042 *\r
2043 *       Return Value\r
2044 *               \82È\82µ\r
2045 *----------------------------------------------------------------------------*/\r
2046 \r
2047 static void DelNotifyAndDo(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDir)\r
2048 {\r
2049         char Path[FMAX_PATH+1];\r
2050 \r
2051         if(Win == WIN_LOCAL)\r
2052         {\r
2053                 AskLocalCurDir(Path, FMAX_PATH);\r
2054                 SetYenTail(Path);\r
2055                 strcat(Path, Dt->File);\r
2056                 ReplaceAll(Path, '/', '\\');\r
2057         }\r
2058         else\r
2059         {\r
2060                 AskRemoteCurDir(Path, FMAX_PATH);\r
2061                 SetSlashTail(Path);\r
2062                 strcat(Path, Dt->File);\r
2063                 ReplaceAll(Path, '\\', '/');\r
2064         }\r
2065 \r
2066         if(*Sw != YES_ALL)\r
2067         {\r
2068                 sprintf(TmpString, "%s", Path);\r
2069 \r
2070                 if(AskHostType() == HTYPE_VMS)\r
2071                         ReformToVMSstylePathName(TmpString);\r
2072 \r
2073                 CurWin = Win;\r
2074                 *Sw = DialogBox(GetFtpInst(), MAKEINTRESOURCE(delete_dlg), GetMainHwnd(), DeleteDialogCallBack);\r
2075         }\r
2076 \r
2077         if((*Sw == YES) || (*Sw == YES_ALL))\r
2078         {\r
2079                 if(Win == WIN_LOCAL)\r
2080                 {\r
2081                         if(Dt->Node == NODE_FILE)\r
2082                                 DoLocalDELE(Path);\r
2083                         else\r
2084                                 DoLocalRMD(Path);\r
2085                         *Flg = YES;\r
2086                 }\r
2087                 else\r
2088                 {\r
2089                         /* \83t\83\8b\83p\83X\82ð\8eg\82í\82È\82¢\8e\9e\82Ì\82½\82ß\82Ì\8f\88\97\9d */\r
2090                         if(ProcForNonFullpath(Path, CurDir, GetMainHwnd(), 0) == FAIL)\r
2091                                 *Sw = NO_ALL;\r
2092 \r
2093                         if(*Sw != NO_ALL)\r
2094                         {\r
2095                                 if(Dt->Node == NODE_FILE)\r
2096                                         DoDELE(Path);\r
2097                                 else\r
2098                                         DoRMD(Path);\r
2099                                 *Flg = YES;\r
2100                         }\r
2101                 }\r
2102         }\r
2103         return;\r
2104 }\r
2105 \r
2106 \r
2107 /*----- \83t\83@\83C\83\8b\8dí\8f\9c\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ----------------------------------\r
2108 *\r
2109 *       Parameter\r
2110 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2111 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
2112 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
2113 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
2114 *\r
2115 *       Return Value\r
2116 *               BOOL TRUE/FALSE\r
2117 *----------------------------------------------------------------------------*/\r
2118 \r
2119 static BOOL CALLBACK DeleteDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
2120 {\r
2121         switch (iMessage)\r
2122         {\r
2123                 case WM_INITDIALOG :\r
2124                         if(CurWin == WIN_LOCAL)\r
2125                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN066);\r
2126                         else\r
2127                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN067);\r
2128                         SendDlgItemMessage(hDlg, DELETE_TEXT, WM_SETTEXT, 0, (LPARAM)TmpString);\r
2129                         return(TRUE);\r
2130 \r
2131                 case WM_COMMAND :\r
2132                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
2133                         {\r
2134                                 case IDOK :\r
2135                                         EndDialog(hDlg, YES);\r
2136                                         break;\r
2137 \r
2138                                 case DELETE_NO :\r
2139                                         EndDialog(hDlg, NO);\r
2140                                         break;\r
2141 \r
2142                                 case DELETE_ALL :\r
2143                                         EndDialog(hDlg, YES_ALL);\r
2144                                         break;\r
2145 \r
2146                                 case IDCANCEL :\r
2147                                         EndDialog(hDlg, NO_ALL);\r
2148                                         break;\r
2149                         }\r
2150             return(TRUE);\r
2151         }\r
2152         return(FALSE);\r
2153 }\r
2154 \r
2155 \r
2156 /*----- \83t\83@\83C\83\8b\88ê\97\97\82Å\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82Ì\96¼\91O\82ð\95Ï\8dX\82·\82é ----------------------\r
2157 *\r
2158 *       Parameter\r
2159 *               \82È\82µ\r
2160 *\r
2161 *       Return Value\r
2162 *               \82È\82µ\r
2163 *----------------------------------------------------------------------------*/\r
2164 \r
2165 void RenameProc(void)\r
2166 {\r
2167         int Win;\r
2168         FILELIST *FileListBase;\r
2169         FILELIST *Pos;\r
2170         char New[FMAX_PATH+1];\r
2171         int RenFlg;\r
2172         int Sts;\r
2173 \r
2174         Sts = SUCCESS;\r
2175         if(GetFocus() == GetLocalHwnd())\r
2176                 Win = WIN_LOCAL;\r
2177         else\r
2178         {\r
2179                 Win = WIN_REMOTE;\r
2180                 Sts = CheckClosedAndReconnect();\r
2181         }\r
2182 \r
2183         if(Sts == SUCCESS)\r
2184         {\r
2185                 DisableUserOpe();\r
2186 \r
2187                 FileListBase = NULL;\r
2188                 MakeSelectedFileList(Win, NO, NO, &FileListBase, &CancelFlg);\r
2189 \r
2190                 RenFlg = NO;\r
2191                 Sts = NO;\r
2192                 Pos = FileListBase;\r
2193                 while(Pos != NULL)\r
2194                 {\r
2195                         if((Pos->Node == NODE_FILE) || (Pos->Node == NODE_DIR))\r
2196                         {\r
2197                                 strcpy(TmpString, Pos->File);\r
2198                                 CurWin = Win;\r
2199                                 Sts = DialogBox(GetFtpInst(), MAKEINTRESOURCE(rename_dlg), GetMainHwnd(), RenameDialogCallBack);\r
2200 \r
2201                                 if(Sts == NO_ALL)\r
2202                                         break;\r
2203 \r
2204                                 if((Sts == YES) && (strlen(TmpString) != 0))\r
2205                                 {\r
2206                                         strcpy(New, TmpString);\r
2207                                         if(Win == WIN_LOCAL)\r
2208                                                 DoLocalRENAME(Pos->File, New);\r
2209                                         else\r
2210                                                 DoRENAME(Pos->File, New);\r
2211                                         RenFlg = YES;\r
2212                                 }\r
2213                         }\r
2214                         Pos = Pos->Next;\r
2215                 }\r
2216                 DeleteFileList(&FileListBase);\r
2217 \r
2218                 if(RenFlg == YES)\r
2219                 {\r
2220                         if(Win == WIN_LOCAL)\r
2221                                 GetLocalDirForWnd();\r
2222                         else\r
2223                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
2224                 }\r
2225 \r
2226                 EnableUserOpe();\r
2227         }\r
2228         return;\r
2229 }\r
2230 \r
2231 \r
2232 //\r
2233 // \83\8a\83\82\81[\83g\91¤\82Å\82Ì\83t\83@\83C\83\8b\82Ì\88Ú\93®\81i\83\8a\83l\81[\83\80\81j\82ð\8ds\82¤\r
2234 //  \r
2235 // RenameProc()\82ð\83x\81[\83X\82É\89ü\91¢\81B(2007.9.5 yutaka)\r
2236 //\r
2237 void MoveRemoteFileProc(int drop_index)\r
2238 {\r
2239         int Win;\r
2240         FILELIST *FileListBase;\r
2241         FILELIST *Pos;\r
2242         FILELIST Pkt;\r
2243         char New[FMAX_PATH+1];\r
2244         char Old[FMAX_PATH+1];\r
2245         char HostDir[FMAX_PATH+1];\r
2246         int RenFlg;\r
2247         int Sts;\r
2248 \r
2249         if(MoveMode == MOVE_DISABLE)\r
2250         {\r
2251                 return;\r
2252         }\r
2253 \r
2254         AskRemoteCurDir(HostDir, FMAX_PATH);\r
2255 \r
2256         // \83h\83\8d\83b\83v\90æ\82Ì\83t\83H\83\8b\83_\96¼\82ð\93¾\82é\r
2257         GetNodeName(WIN_REMOTE, drop_index, Pkt.File, FMAX_PATH);\r
2258 \r
2259         if(MoveMode == MOVE_DLG)\r
2260         {\r
2261                 if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(move_notify_dlg), GetRemoteHwnd(), ExeEscTextDialogProc, (LPARAM)Pkt.File) == NO)\r
2262                 {\r
2263                         return;\r
2264                 }\r
2265         }\r
2266 \r
2267         Sts = SUCCESS;\r
2268 #if 0\r
2269         if(GetFocus() == GetLocalHwnd())\r
2270                 Win = WIN_LOCAL;\r
2271         else\r
2272         {\r
2273                 Win = WIN_REMOTE;\r
2274                 Sts = CheckClosedAndReconnect();\r
2275         }\r
2276 #else\r
2277                 Win = WIN_REMOTE;\r
2278                 Sts = CheckClosedAndReconnect();\r
2279 #endif\r
2280 \r
2281         if(Sts == SUCCESS)\r
2282         {\r
2283                 DisableUserOpe();\r
2284 \r
2285                 FileListBase = NULL;\r
2286                 MakeSelectedFileList(Win, NO, NO, &FileListBase, &CancelFlg);\r
2287 \r
2288                 RenFlg = NO;\r
2289                 Sts = NO;\r
2290                 Pos = FileListBase;\r
2291                 while(Pos != NULL)\r
2292                 {\r
2293                         if((Pos->Node == NODE_FILE) || (Pos->Node == NODE_DIR))\r
2294                         {\r
2295                                 strcpy(TmpString, Pos->File);\r
2296                                 CurWin = Win;\r
2297 #if 0\r
2298                                 Sts = DialogBox(GetFtpInst(), MAKEINTRESOURCE(rename_dlg), GetMainHwnd(), RenameDialogCallBack);\r
2299 \r
2300                                 if(Sts == NO_ALL)\r
2301                                         break;\r
2302 #else\r
2303                                 Sts = YES;\r
2304 #endif\r
2305 \r
2306                                 if((Sts == YES) && (strlen(TmpString) != 0))\r
2307                                 {\r
2308                                         // \83p\83X\82Ì\90Ý\92è(local)\r
2309                                         strncpy_s(Old, sizeof(Old), HostDir, _TRUNCATE);\r
2310                                         strncat_s(Old, sizeof(Old), "/", _TRUNCATE);\r
2311                                         strncat_s(Old, sizeof(Old), Pos->File, _TRUNCATE);\r
2312 \r
2313                                         // \83p\83X\82Ì\90Ý\92è(remote)\r
2314                                         strncpy_s(New, sizeof(New), HostDir, _TRUNCATE);\r
2315                                         strncat_s(New, sizeof(New), "/", _TRUNCATE);\r
2316                                         strncat_s(New, sizeof(New), Pkt.File, _TRUNCATE);\r
2317                                         strncat_s(New, sizeof(New), "/", _TRUNCATE);\r
2318                                         strncat_s(New, sizeof(New), Pos->File, _TRUNCATE);\r
2319 \r
2320                                         if(Win == WIN_LOCAL)\r
2321                                                 DoLocalRENAME(Old, New);\r
2322                                         else\r
2323                                                 DoRENAME(Old, New);\r
2324                                         RenFlg = YES;\r
2325                                 }\r
2326                         }\r
2327                         Pos = Pos->Next;\r
2328                 }\r
2329                 DeleteFileList(&FileListBase);\r
2330 \r
2331                 if(RenFlg == YES)\r
2332                 {\r
2333                         if(Win == WIN_LOCAL) {\r
2334                                 GetLocalDirForWnd();\r
2335                         } else {\r
2336                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
2337 \r
2338                                 strncpy_s(New, sizeof(New), HostDir, _TRUNCATE);\r
2339                                 strncat_s(New, sizeof(New), "/", _TRUNCATE);\r
2340                                 strncat_s(New, sizeof(New), Pkt.File, _TRUNCATE);\r
2341                                 DoCWD(New, YES, YES, YES);\r
2342                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
2343                         }\r
2344                 }\r
2345 \r
2346                 EnableUserOpe();\r
2347         }\r
2348         return;\r
2349 }\r
2350 \r
2351 \r
2352 \r
2353 /*----- \90V\83t\83@\83C\83\8b\96¼\93ü\97Í\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ------------------------------\r
2354 *\r
2355 *       Parameter\r
2356 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2357 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
2358 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
2359 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
2360 *\r
2361 *       Return Value\r
2362 *               BOOL TRUE/FALSE\r
2363 *----------------------------------------------------------------------------*/\r
2364 \r
2365 static BOOL CALLBACK RenameDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
2366 {\r
2367         switch (iMessage)\r
2368         {\r
2369                 case WM_INITDIALOG :\r
2370                         if(CurWin == WIN_LOCAL)\r
2371                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN068);\r
2372                         else\r
2373                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN069);\r
2374                         SendDlgItemMessage(hDlg, RENAME_NEW, EM_LIMITTEXT, FMAX_PATH, 0);\r
2375                         SendDlgItemMessage(hDlg, RENAME_NEW, WM_SETTEXT, 0, (LPARAM)TmpString);\r
2376                         SendDlgItemMessage(hDlg, RENAME_TEXT, WM_SETTEXT, 0, (LPARAM)TmpString);\r
2377                         return(TRUE);\r
2378 \r
2379                 case WM_COMMAND :\r
2380                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
2381                         {\r
2382                                 case IDOK :\r
2383                                         SendDlgItemMessage(hDlg, RENAME_NEW, WM_GETTEXT, FMAX_PATH, (LPARAM)TmpString);\r
2384                                         EndDialog(hDlg, YES);\r
2385                                         break;\r
2386 \r
2387                                 case IDCANCEL :\r
2388                                         EndDialog(hDlg, NO);\r
2389                                         break;\r
2390 \r
2391                                 case RENAME_STOP :\r
2392                                         EndDialog(hDlg, NO_ALL);\r
2393                                         break;\r
2394                         }\r
2395             return(TRUE);\r
2396         }\r
2397         return(FALSE);\r
2398 }\r
2399 \r
2400 \r
2401 /*----- \90V\82µ\82¢\83f\83B\83\8c\83N\83g\83\8a\82ð\8dì\90¬\82·\82é ------------------------------------------\r
2402 *\r
2403 *       Parameter\r
2404 *               \82È\82µ\r
2405 *\r
2406 *       Return Value\r
2407 *               \82È\82µ\r
2408 *----------------------------------------------------------------------------*/\r
2409 \r
2410 void MkdirProc(void)\r
2411 {\r
2412         int Sts;\r
2413         int Win;\r
2414         char Path[FMAX_PATH+1];\r
2415         char *Title;\r
2416         int Tmp;\r
2417 \r
2418         if(GetFocus() == GetLocalHwnd())\r
2419         {\r
2420                 Win = WIN_LOCAL;\r
2421                 Title = MSGJPN070;\r
2422         }\r
2423         else\r
2424         {\r
2425                 Win = WIN_REMOTE;\r
2426                 Title = MSGJPN071;\r
2427         }\r
2428 \r
2429         strcpy(Path, "");\r
2430         Sts = InputDialogBox(mkdir_dlg, GetMainHwnd(), Title, Path, FMAX_PATH+1, &Tmp, IDH_HELP_TOPIC_0000001);\r
2431 \r
2432         if((Sts == YES) && (strlen(Path) != 0))\r
2433         {\r
2434                 if(Win == WIN_LOCAL)\r
2435                 {\r
2436                         DisableUserOpe();\r
2437                         DoLocalMKD(Path);\r
2438                         GetLocalDirForWnd();\r
2439                         EnableUserOpe();\r
2440                 }\r
2441                 else\r
2442                 {\r
2443                         if(CheckClosedAndReconnect() == SUCCESS)\r
2444                         {\r
2445                                 DisableUserOpe();\r
2446                                 DoMKD(Path);\r
2447                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
2448                                 EnableUserOpe();\r
2449                         }\r
2450                 }\r
2451         }\r
2452         return;\r
2453 }\r
2454 \r
2455 \r
2456 /*----- \83q\83X\83g\83\8a\83\8a\83X\83g\82ð\8eg\82Á\82½\83f\83B\83\8c\83N\83g\83\8a\82Ì\88Ú\93® ------------------------------\r
2457 *\r
2458 *       Parameter\r
2459 *               HWND hWnd : \83R\83\93\83{\83{\83b\83N\83X\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2460 *\r
2461 *       Return Value\r
2462 *               \82È\82µ\r
2463 *----------------------------------------------------------------------------*/\r
2464 \r
2465 void ChangeDirComboProc(HWND hWnd)\r
2466 {\r
2467         char Tmp[FMAX_PATH+1];\r
2468         int i;\r
2469 \r
2470         if((i = SendMessage(hWnd, CB_GETCURSEL, 0, 0)) != CB_ERR)\r
2471         {\r
2472                 SendMessage(hWnd, CB_GETLBTEXT, i, (LPARAM)Tmp);\r
2473 \r
2474                 if(hWnd == GetLocalHistHwnd())\r
2475                 {\r
2476                         DisableUserOpe();\r
2477                         DoLocalCWD(Tmp);\r
2478                         GetLocalDirForWnd();\r
2479                         EnableUserOpe();\r
2480                 }\r
2481                 else\r
2482                 {\r
2483                         if(CheckClosedAndReconnect() == SUCCESS)\r
2484                         {\r
2485                                 DisableUserOpe();\r
2486                                 if(DoCWD(Tmp, YES, NO, YES) < FTP_RETRY)\r
2487                                         GetRemoteDirForWnd(CACHE_NORMAL, &CancelFlg);\r
2488                                 EnableUserOpe();\r
2489                         }\r
2490                 }\r
2491         }\r
2492         return;\r
2493 }\r
2494 \r
2495 \r
2496 /*----- \83u\83b\83N\83}\81[\83N\82ð\8eg\82Á\82½\83f\83B\83\8c\83N\83g\83\8a\82Ì\88Ú\93® --------------------------------\r
2497 *\r
2498 *       Parameter\r
2499 *               int MarkID : \83u\83b\83N\83}\81[\83N\82Ì\83\81\83j\83\85\81[ID\r
2500 *\r
2501 *       Return Value\r
2502 *               \82È\82µ\r
2503 *----------------------------------------------------------------------------*/\r
2504 \r
2505 void ChangeDirBmarkProc(int MarkID)\r
2506 {\r
2507         char Local[FMAX_PATH+1];\r
2508         char Remote[FMAX_PATH+1];\r
2509         int Sts;\r
2510 \r
2511         Sts = AskBookMarkText(MarkID, Local, Remote, FMAX_PATH+1);\r
2512         if((Sts == BMARK_TYPE_LOCAL) || (Sts == BMARK_TYPE_BOTH))\r
2513         {\r
2514                 DisableUserOpe();\r
2515                 if(DoLocalCWD(Local) == SUCCESS)\r
2516                         GetLocalDirForWnd();\r
2517                 EnableUserOpe();\r
2518         }\r
2519 \r
2520         if((Sts == BMARK_TYPE_REMOTE) || (Sts == BMARK_TYPE_BOTH))\r
2521         {\r
2522                 if(CheckClosedAndReconnect() == SUCCESS)\r
2523                 {\r
2524                         DisableUserOpe();\r
2525                         if(DoCWD(Remote, YES, NO, YES) < FTP_RETRY)\r
2526                                 GetRemoteDirForWnd(CACHE_NORMAL, &CancelFlg);\r
2527                         EnableUserOpe();\r
2528                 }\r
2529         }\r
2530         return;\r
2531 }\r
2532 \r
2533 \r
2534 /*----- \83f\83B\83\8c\83N\83g\83\8a\96¼\82ð\93ü\97Í\82µ\82Ä\83f\83B\83\8c\83N\83g\83\8a\82Ì\88Ú\93® ----------------------------\r
2535 *\r
2536 *       Parameter\r
2537 *               int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
2538 *\r
2539 *       Return Value\r
2540 *               \82È\82µ\r
2541 *----------------------------------------------------------------------------*/\r
2542 \r
2543 void ChangeDirDirectProc(int Win)\r
2544 {\r
2545         int Sts;\r
2546         char Path[FMAX_PATH+1];\r
2547         char *Title;\r
2548         int Tmp;\r
2549 \r
2550         if(Win == WIN_LOCAL)\r
2551                 Title = MSGJPN072;\r
2552         else\r
2553                 Title = MSGJPN073;\r
2554 \r
2555         strcpy(Path, "");\r
2556         if(Win == WIN_LOCAL)\r
2557                 Sts = InputDialogBox(chdir_br_dlg, GetMainHwnd(), Title, Path, FMAX_PATH+1, &Tmp, IDH_HELP_TOPIC_0000001);\r
2558         else\r
2559                 Sts = InputDialogBox(chdir_dlg, GetMainHwnd(), Title, Path, FMAX_PATH+1, &Tmp, IDH_HELP_TOPIC_0000001);\r
2560 \r
2561         if((Sts == YES) && (strlen(Path) != 0))\r
2562         {\r
2563                 if(Win == WIN_LOCAL)\r
2564                 {\r
2565                         DisableUserOpe();\r
2566                         DoLocalCWD(Path);\r
2567                         GetLocalDirForWnd();\r
2568                         EnableUserOpe();\r
2569                 }\r
2570                 else\r
2571                 {\r
2572                         if(CheckClosedAndReconnect() == SUCCESS)\r
2573                         {\r
2574                                 DisableUserOpe();\r
2575                                 if(DoCWD(Path, YES, NO, YES) < FTP_RETRY)\r
2576                                         GetRemoteDirForWnd(CACHE_NORMAL, &CancelFlg);\r
2577                                 EnableUserOpe();\r
2578                         }\r
2579                 }\r
2580         }\r
2581         return;\r
2582 }\r
2583 \r
2584 \r
2585 /*----- Drop\82³\82ê\82½\83t\83@\83C\83\8b\82É\82æ\82é\83f\83B\83\8c\83N\83g\83\8a\82Ì\88Ú\93® ----------------------------\r
2586 *\r
2587 *       Parameter\r
2588 *               WPARAM wParam : \83h\83\8d\83b\83v\82³\82ê\82½\83t\83@\83C\83\8b\82Ì\8fî\95ñ\r
2589 *\r
2590 *       Return Value\r
2591 *               \82È\82µ\r
2592 *----------------------------------------------------------------------------*/\r
2593 \r
2594 void ChangeDirDropFileProc(WPARAM wParam)\r
2595 {\r
2596         char Path[FMAX_PATH+1];\r
2597 \r
2598         DisableUserOpe();\r
2599         MakeDroppedDir(wParam, Path);\r
2600         DoLocalCWD(Path);\r
2601         GetLocalDirForWnd();\r
2602         EnableUserOpe();\r
2603         return;\r
2604 }\r
2605 \r
2606 \r
2607 /*----- \83t\83@\83C\83\8b\82Ì\91®\90«\95Ï\8dX ----------------------------------------------------\r
2608 *\r
2609 *       Parameter\r
2610 *               \82È\82µ\r
2611 *\r
2612 *       Return Value\r
2613 *               \82È\82µ\r
2614 *----------------------------------------------------------------------------*/\r
2615 \r
2616 void ChmodProc(void)\r
2617 {\r
2618         int ChmodFlg;\r
2619         FILELIST *FileListBase;\r
2620         FILELIST *Pos;\r
2621         char Tmp[5];\r
2622         char *Buf;\r
2623         char *BufTmp;\r
2624         int BufLen;\r
2625 \r
2626         if(GetFocus() == GetRemoteHwnd())\r
2627         {\r
2628                 if(CheckClosedAndReconnect() == SUCCESS)\r
2629                 {\r
2630                         DisableUserOpe();\r
2631                         FileListBase = NULL;\r
2632                         MakeSelectedFileList(WIN_REMOTE, NO, NO, &FileListBase, &CancelFlg);\r
2633                         if(FileListBase != NULL)\r
2634                         {\r
2635                                 sprintf(Tmp, "%03X", FileListBase->Attr);\r
2636                                 if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(chmod_dlg), GetMainHwnd(), ChmodDialogCallBack, (LPARAM)Tmp) == YES)\r
2637                                 {\r
2638                                         ChmodFlg = NO;\r
2639                                         Pos = FileListBase;\r
2640                                         while(Pos != NULL)\r
2641                                         {\r
2642                                                 if((Pos->Node == NODE_FILE) || (Pos->Node == NODE_DIR))\r
2643                                                 {\r
2644                                                         DoCHMOD(Pos->File, Tmp);\r
2645                                                         ChmodFlg = YES;\r
2646                                                 }\r
2647                                                 Pos = Pos->Next;\r
2648                                         }\r
2649                                         if(ChmodFlg == YES)\r
2650                                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
2651                                 }\r
2652                         }\r
2653                         DeleteFileList(&FileListBase);\r
2654                         EnableUserOpe();\r
2655                 }\r
2656         }\r
2657         else if(GetFocus() == GetLocalHwnd())\r
2658         {\r
2659                 DisableUserOpe();\r
2660                 FileListBase = NULL;\r
2661                 MakeSelectedFileList(WIN_LOCAL, NO, NO, &FileListBase, &CancelFlg);\r
2662                 if(FileListBase != NULL)\r
2663                 {\r
2664                         if((Buf = malloc(1)) != NULL)\r
2665                         {\r
2666                                 *Buf = NUL;\r
2667                                 BufLen = 0;\r
2668                                 Pos = FileListBase;\r
2669                                 while(Pos != NULL)\r
2670                                 {\r
2671                                         if((BufTmp = realloc(Buf, BufLen + strlen(Pos->File) + 2)) != NULL)\r
2672                                         {\r
2673                                                 Buf = BufTmp;\r
2674                                                 strcpy(Buf+BufLen, Pos->File);\r
2675                                                 BufLen += strlen(Pos->File) + 1;\r
2676                                         }\r
2677                                         Pos = Pos->Next;\r
2678                                 }\r
2679 \r
2680                                 memset(Buf+BufLen, NUL, 1);\r
2681                                 DispFileProperty(Buf);\r
2682                                 free(Buf);\r
2683                         }\r
2684                 }\r
2685                 DeleteFileList(&FileListBase);\r
2686                 EnableUserOpe();\r
2687         }\r
2688         return;\r
2689 }\r
2690 \r
2691 \r
2692 /*----- \91®\90«\95Ï\8dX\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N --------------------------------------\r
2693 *\r
2694 *       Parameter\r
2695 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2696 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
2697 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
2698 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
2699 *\r
2700 *       Return Value\r
2701 *               BOOL TRUE/FALSE\r
2702 *----------------------------------------------------------------------------*/\r
2703 \r
2704 BOOL CALLBACK ChmodDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
2705 {\r
2706         char Str[5];\r
2707         static char *Buf;\r
2708         int Tmp;\r
2709 \r
2710         switch (iMessage)\r
2711         {\r
2712                 case WM_INITDIALOG :\r
2713                         Buf = (char *)lParam;\r
2714                         SendDlgItemMessage(hDlg, PERM_NOW, EM_LIMITTEXT, 4, 0);\r
2715                         SendDlgItemMessage(hDlg, PERM_NOW, WM_SETTEXT, 0, (LPARAM)Buf);\r
2716                         SetAttrToDialog(hDlg, xtoi(Buf));\r
2717                         return(TRUE);\r
2718 \r
2719                 case WM_COMMAND :\r
2720                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
2721                         {\r
2722                                 case IDOK :\r
2723                                         SendDlgItemMessage(hDlg, PERM_NOW, WM_GETTEXT, 5, (LPARAM)Buf);\r
2724                                         EndDialog(hDlg, YES);\r
2725                                         break;\r
2726 \r
2727                                 case IDCANCEL :\r
2728                                         EndDialog(hDlg, NO);\r
2729                                         break;\r
2730 \r
2731                                 case PERM_O_READ :\r
2732                                 case PERM_O_WRITE :\r
2733                                 case PERM_O_EXEC :\r
2734                                 case PERM_G_READ :\r
2735                                 case PERM_G_WRITE :\r
2736                                 case PERM_G_EXEC :\r
2737                                 case PERM_A_READ :\r
2738                                 case PERM_A_WRITE :\r
2739                                 case PERM_A_EXEC :\r
2740                                         Tmp = GetAttrFromDialog(hDlg);\r
2741                                         sprintf(Str, "%03X", Tmp);\r
2742                                         SendDlgItemMessage(hDlg, PERM_NOW, WM_SETTEXT, 0, (LPARAM)Str);\r
2743                                         break;\r
2744 \r
2745                                 case IDHELP :\r
2746                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000017);\r
2747                                         break;\r
2748                         }\r
2749             return(TRUE);\r
2750         }\r
2751         return(FALSE);\r
2752 }\r
2753 \r
2754 \r
2755 /*----- \91®\90«\82ð\83_\83C\83A\83\8d\83O\83{\83b\83N\83X\82É\90Ý\92è ----------------------------------------\r
2756 *\r
2757 *       Parameter\r
2758 *               HWND hWnd : \83_\83C\83A\83\8d\83O\83{\83b\83N\83X\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2759 *               int Attr : \91®\90«\r
2760 *\r
2761 *       Return Value\r
2762 *               \82È\82µ\r
2763 *----------------------------------------------------------------------------*/\r
2764 \r
2765 static void SetAttrToDialog(HWND hDlg, int Attr)\r
2766 {\r
2767         if(Attr & 0x400)\r
2768                 SendDlgItemMessage(hDlg, PERM_O_READ, BM_SETCHECK, 1, 0);\r
2769         if(Attr & 0x200)\r
2770                 SendDlgItemMessage(hDlg, PERM_O_WRITE, BM_SETCHECK, 1, 0);\r
2771         if(Attr & 0x100)\r
2772                 SendDlgItemMessage(hDlg, PERM_O_EXEC, BM_SETCHECK, 1, 0);\r
2773 \r
2774         if(Attr & 0x40)\r
2775                 SendDlgItemMessage(hDlg, PERM_G_READ, BM_SETCHECK, 1, 0);\r
2776         if(Attr & 0x20)\r
2777                 SendDlgItemMessage(hDlg, PERM_G_WRITE, BM_SETCHECK, 1, 0);\r
2778         if(Attr & 0x10)\r
2779                 SendDlgItemMessage(hDlg, PERM_G_EXEC, BM_SETCHECK, 1, 0);\r
2780 \r
2781         if(Attr & 0x4)\r
2782                 SendDlgItemMessage(hDlg, PERM_A_READ, BM_SETCHECK, 1, 0);\r
2783         if(Attr & 0x2)\r
2784                 SendDlgItemMessage(hDlg, PERM_A_WRITE, BM_SETCHECK, 1, 0);\r
2785         if(Attr & 0x1)\r
2786                 SendDlgItemMessage(hDlg, PERM_A_EXEC, BM_SETCHECK, 1, 0);\r
2787 \r
2788         return;\r
2789 }\r
2790 \r
2791 \r
2792 /*----- \83_\83C\83A\83\8d\83O\83{\83b\83N\83X\82Ì\93à\97e\82©\82ç\91®\90«\82ð\8eæ\93¾ --------------------------------\r
2793 *\r
2794 *       Parameter\r
2795 *               HWND hWnd : \83_\83C\83A\83\8d\83O\83{\83b\83N\83X\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2796 *\r
2797 *       Return Value\r
2798 *               int \91®\90«\r
2799 *----------------------------------------------------------------------------*/\r
2800 \r
2801 static int GetAttrFromDialog(HWND hDlg)\r
2802 {\r
2803         int Ret;\r
2804 \r
2805         Ret = 0;\r
2806 \r
2807         if(SendDlgItemMessage(hDlg, PERM_O_READ, BM_GETCHECK, 0, 0) == 1)\r
2808                 Ret |= 0x400;\r
2809         if(SendDlgItemMessage(hDlg, PERM_O_WRITE, BM_GETCHECK, 0, 0) == 1)\r
2810                 Ret |= 0x200;\r
2811         if(SendDlgItemMessage(hDlg, PERM_O_EXEC, BM_GETCHECK, 0, 0) == 1)\r
2812                 Ret |= 0x100;\r
2813 \r
2814         if(SendDlgItemMessage(hDlg, PERM_G_READ, BM_GETCHECK, 0, 0) == 1)\r
2815                 Ret |= 0x40;\r
2816         if(SendDlgItemMessage(hDlg, PERM_G_WRITE, BM_GETCHECK, 0, 0) == 1)\r
2817                 Ret |= 0x20;\r
2818         if(SendDlgItemMessage(hDlg, PERM_G_EXEC, BM_GETCHECK, 0, 0) == 1)\r
2819                 Ret |= 0x10;\r
2820 \r
2821         if(SendDlgItemMessage(hDlg, PERM_A_READ, BM_GETCHECK, 0, 0) == 1)\r
2822                 Ret |= 0x4;\r
2823         if(SendDlgItemMessage(hDlg, PERM_A_WRITE, BM_GETCHECK, 0, 0) == 1)\r
2824                 Ret |= 0x2;\r
2825         if(SendDlgItemMessage(hDlg, PERM_A_EXEC, BM_GETCHECK, 0, 0) == 1)\r
2826                 Ret |= 0x1;\r
2827 \r
2828         return(Ret);\r
2829 }\r
2830 \r
2831 \r
2832 \r
2833 \r
2834 /*----- \94C\88Ó\82Ì\83R\83}\83\93\83h\82ð\91\97\82é --------------------------------------------------\r
2835 *\r
2836 *       Parameter\r
2837 *               \82È\82µ\r
2838 *\r
2839 *       Return Value\r
2840 *               \82È\82µ\r
2841 *----------------------------------------------------------------------------*/\r
2842 \r
2843 void SomeCmdProc(void)\r
2844 {\r
2845         char Cmd[81];\r
2846         int Tmp;\r
2847         FILELIST *FileListBase;\r
2848 \r
2849         if(GetFocus() == GetRemoteHwnd())\r
2850         {\r
2851                 if(CheckClosedAndReconnect() == SUCCESS)\r
2852                 {\r
2853                         DisableUserOpe();\r
2854                         FileListBase = NULL;\r
2855                         MakeSelectedFileList(WIN_REMOTE, NO, NO, &FileListBase, &CancelFlg);\r
2856                         memset(Cmd, NUL, 81);\r
2857                         if(FileListBase != NULL)\r
2858                         {\r
2859                                 strncpy(Cmd, FileListBase->File, 80);\r
2860                         }\r
2861                         DeleteFileList(&FileListBase);\r
2862 \r
2863                         if(InputDialogBox(somecmd_dlg, GetMainHwnd(), NULL, Cmd, 81, &Tmp, IDH_HELP_TOPIC_0000023) == YES)\r
2864                         {\r
2865                                 DoQUOTE(Cmd);\r
2866                         }\r
2867                         EnableUserOpe();\r
2868                 }\r
2869         }\r
2870         return;\r
2871 }\r
2872 \r
2873 \r
2874 \r
2875 \r
2876 /*----- \83t\83@\83C\83\8b\91\8d\97e\97Ê\82Ì\8cv\8eZ\82ð\8ds\82¤ --------------------------------------------\r
2877 *\r
2878 *       Parameter\r
2879 *               \82È\82µ\r
2880 *\r
2881 *       Return Value\r
2882 *               \82È\82µ\r
2883 *----------------------------------------------------------------------------*/\r
2884 \r
2885 void CalcFileSizeProc(void)\r
2886 {\r
2887         FILELIST *ListBase;\r
2888         FILELIST *Pos;\r
2889         int Win;\r
2890         int All;\r
2891         int Sts;\r
2892 \r
2893         if((All = DialogBox(GetFtpInst(), MAKEINTRESOURCE(filesize_notify_dlg), GetMainHwnd(), SizeNotifyDlgWndProc)) != NO_ALL)\r
2894         {\r
2895                 Sts = SUCCESS;\r
2896                 if(GetFocus() == GetLocalHwnd())\r
2897                         Win = WIN_LOCAL;\r
2898                 else\r
2899                 {\r
2900                         Win = WIN_REMOTE;\r
2901                         Sts = CheckClosedAndReconnect();\r
2902                 }\r
2903 \r
2904                 if(Sts == SUCCESS)\r
2905                 {\r
2906                         ListBase = NULL;\r
2907                         MakeSelectedFileList(Win, YES, All, &ListBase, &CancelFlg);\r
2908 \r
2909                         FileSize = 0;\r
2910                         Pos = ListBase;\r
2911                         while(Pos != NULL)\r
2912                         {\r
2913                                 if(Pos->Node != NODE_DIR)\r
2914                                         FileSize += Pos->Size;\r
2915                                 Pos = Pos->Next;\r
2916                         }\r
2917                         DeleteFileList(&ListBase);\r
2918                         DialogBox(GetFtpInst(), MAKEINTRESOURCE(filesize_dlg), GetMainHwnd(), SizeDlgWndProc);\r
2919                 }\r
2920         }\r
2921         return;\r
2922 }\r
2923 \r
2924 \r
2925 /*----- \83t\83@\83C\83\8b\97e\97Ê\8c\9f\8dõ\8am\94F\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N --------------------------\r
2926 *\r
2927 *       Parameter\r
2928 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2929 *               UINT message  : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
2930 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
2931 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
2932 *\r
2933 *       Return Value\r
2934 *               \83\81\83b\83Z\81[\83W\82É\91Î\89\9e\82·\82é\96ß\82è\92l\r
2935 *----------------------------------------------------------------------------*/\r
2936 \r
2937 static LRESULT CALLBACK SizeNotifyDlgWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
2938 {\r
2939         switch (message)\r
2940         {\r
2941                 case WM_INITDIALOG :\r
2942                         if(GetFocus() == GetLocalHwnd())\r
2943                                 SendDlgItemMessage(hDlg, FSNOTIFY_TITLE, WM_SETTEXT, 0, (LPARAM)MSGJPN074);\r
2944                         else\r
2945                                 SendDlgItemMessage(hDlg, FSNOTIFY_TITLE, WM_SETTEXT, 0, (LPARAM)MSGJPN075);\r
2946                         return(TRUE);\r