OSDN Git Service

Change behavior of automatic IPv4/IPv6 selection.
[ffftp/ffftp.git] / option.c
1 /*=============================================================================\r
2 *\r
3 *                                                               オプション設定\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 // IPv6対応\r
32 #include <winsock2.h>\r
33 #include <windows.h>\r
34 #include <stdio.h>\r
35 #include <stdlib.h>\r
36 #include <string.h>\r
37 #include <commctrl.h>\r
38 #include <windowsx.h>\r
39 \r
40 #include "common.h"\r
41 #include "resource.h"\r
42 \r
43 #include <htmlhelp.h>\r
44 #include "helpid.h"\r
45 \r
46 // UTF-8対応\r
47 #undef __MBSWRAPPER_H__\r
48 #include "mbswrapper.h"\r
49 \r
50 \r
51 /*===== プロトタイプ =====*/\r
52 \r
53 // 64ビット対応\r
54 //static BOOL CALLBACK UserSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
55 //static BOOL CALLBACK Trmode1SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
56 //static BOOL CALLBACK Trmode2SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
57 //static BOOL CALLBACK Trmode3SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
58 //static BOOL CALLBACK DefAttrDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
59 static INT_PTR CALLBACK UserSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
60 static INT_PTR CALLBACK Trmode1SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
61 static INT_PTR CALLBACK Trmode2SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
62 static INT_PTR CALLBACK Trmode3SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
63 static INT_PTR CALLBACK DefAttrDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
64 static void AddFnameAttrToListView(HWND hDlg, char *Fname, char *Attr);\r
65 static void GetFnameAttrFromListView(HWND hDlg, char *Buf);\r
66 // 64ビット対応\r
67 //static BOOL CALLBACK MirrorSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
68 //static BOOL CALLBACK NotifySettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
69 //static BOOL CALLBACK DispSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
70 static INT_PTR CALLBACK MirrorSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
71 static INT_PTR CALLBACK NotifySettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
72 static INT_PTR CALLBACK DispSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
73 static int SelectListFont(HWND hWnd, LOGFONT *lFont);\r
74 // 64ビット対応\r
75 //static BOOL CALLBACK ConnectSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
76 //static BOOL CALLBACK FireSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
77 //static BOOL CALLBACK ToolSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
78 //static BOOL CALLBACK SoundSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
79 //static BOOL CALLBACK MiscSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
80 //static BOOL CALLBACK SortSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
81 static INT_PTR CALLBACK ConnectSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
82 static INT_PTR CALLBACK FireSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
83 static INT_PTR CALLBACK ToolSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
84 static INT_PTR CALLBACK SoundSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
85 static INT_PTR CALLBACK MiscSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
86 static INT_PTR CALLBACK SortSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
87 // hostman.cで使用\r
88 //static int GetDecimalText(HWND hDlg, int Ctrl);\r
89 //static void SetDecimalText(HWND hDlg, int Ctrl, int Num);\r
90 //static void CheckRange2(int *Cur, int Max, int Min);\r
91 //static void AddTextToListBox(HWND hDlg, char *Str, int CtrlList, int BufSize);\r
92 //static void SetMultiTextToList(HWND hDlg, int CtrlList, char *Text);\r
93 //static void GetMultiTextFromList(HWND hDlg, int CtrlList, char *Buf, int BufSize);\r
94 int GetDecimalText(HWND hDlg, int Ctrl);\r
95 void SetDecimalText(HWND hDlg, int Ctrl, int Num);\r
96 void CheckRange2(int *Cur, int Max, int Min);\r
97 void AddTextToListBox(HWND hDlg, char *Str, int CtrlList, int BufSize);\r
98 void SetMultiTextToList(HWND hDlg, int CtrlList, char *Text);\r
99 void GetMultiTextFromList(HWND hDlg, int CtrlList, char *Buf, int BufSize);\r
100 \r
101 \r
102 \r
103 typedef struct {\r
104         char Fname[FMAX_PATH+1];\r
105         char Attr[5];\r
106 } ATTRSET;\r
107 \r
108 \r
109 \r
110 \r
111 \r
112 /*===== 外部参照 =====*/\r
113 \r
114 extern HWND hHelpWin;\r
115 \r
116 /* 設定値 */\r
117 extern char UserMailAdrs[USER_MAIL_LEN+1];\r
118 extern char ViewerName[VIEWERS][FMAX_PATH+1];\r
119 extern int ConnectOnStart;\r
120 extern int DebugConsole;\r
121 extern int SaveWinPos;\r
122 extern char AsciiExt[ASCII_EXT_LEN+1];\r
123 extern int RecvMode;\r
124 extern int SendMode;\r
125 extern int MoveMode;\r
126 extern int CacheEntry;\r
127 extern int CacheSave;\r
128 extern char FwallHost[HOST_ADRS_LEN+1];\r
129 extern char FwallUser[USER_NAME_LEN+1];\r
130 extern char FwallPass[PASSWORD_LEN+1];\r
131 extern int FwallPort;\r
132 extern int FwallType;\r
133 extern int FwallDefault;\r
134 extern int FwallSecurity;\r
135 extern int FwallResolv;\r
136 extern int FwallLower;\r
137 extern int FwallDelimiter;\r
138 extern int PasvDefault;\r
139 extern char DefaultLocalPath[FMAX_PATH+1];\r
140 extern int SaveTimeStamp;\r
141 extern int DclickOpen;\r
142 extern SOUNDFILE Sound[SOUND_TYPES];\r
143 extern int FnameCnv;\r
144 extern int ConnectAndSet;\r
145 extern int TimeOut;\r
146 extern int RmEOF;\r
147 extern int RegType;\r
148 extern char MirrorNoTrn[MIRROR_LEN+1];\r
149 extern char MirrorNoDel[MIRROR_LEN+1];\r
150 extern int MirrorFnameCnv;\r
151 extern int RasClose;\r
152 extern int RasCloseNotify;\r
153 extern int FileHist;\r
154 extern char DefAttrList[DEFATTRLIST_LEN+1];\r
155 extern char TmpPath[FMAX_PATH+1];\r
156 extern int QuickAnonymous;\r
157 extern int PassToHist;\r
158 extern int VaxSemicolon;\r
159 extern int SendQuit;\r
160 extern int NoRasControl;\r
161 extern int DispIgnoreHide;\r
162 extern int DispDrives;\r
163 extern HFONT ListFont;\r
164 extern LOGFONT ListLogFont;\r
165 extern int MirUpDelNotify;\r
166 extern int MirDownDelNotify;\r
167 extern int FolderAttr;\r
168 extern int FolderAttrNum;\r
169 // ファイルアイコン表示対応\r
170 extern int DispFileIcon;\r
171 // ディレクトリ自動作成\r
172 extern int MakeAllDir;\r
173 \r
174 \r
175 /*----- オプションのプロパティシート ------------------------------------------\r
176 *\r
177 *       Parameter\r
178 *               なし\r
179 *\r
180 *       Return Value\r
181 *               なし\r
182 *----------------------------------------------------------------------------*/\r
183 \r
184 void SetOption(int Start)\r
185 {\r
186         PROPSHEETPAGE psp[12];\r
187         PROPSHEETHEADER psh;\r
188 \r
189         // 変数が未初期化のバグ修正\r
190         memset(&psp, 0, sizeof(psp));\r
191         memset(&psh, 0, sizeof(psh));\r
192 \r
193         psp[0].dwSize = sizeof(PROPSHEETPAGE);\r
194         psp[0].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
195         psp[0].hInstance = GetFtpInst();\r
196         psp[0].pszTemplate = MAKEINTRESOURCE(opt_user_dlg);\r
197         psp[0].pszIcon = NULL;\r
198         psp[0].pfnDlgProc = UserSettingProc;\r
199         psp[0].pszTitle = MSGJPN186;\r
200         psp[0].lParam = 0;\r
201         psp[0].pfnCallback = NULL;\r
202 \r
203         psp[1].dwSize = sizeof(PROPSHEETPAGE);\r
204         psp[1].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
205         psp[1].hInstance = GetFtpInst();\r
206         psp[1].pszTemplate = MAKEINTRESOURCE(opt_trmode1_dlg);\r
207         psp[1].pszIcon = NULL;\r
208         psp[1].pfnDlgProc = Trmode1SettingProc;\r
209         psp[1].pszTitle = MSGJPN187;\r
210         psp[1].lParam = 0;\r
211         psp[1].pfnCallback = NULL;\r
212 \r
213         psp[2].dwSize = sizeof(PROPSHEETPAGE);\r
214         psp[2].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
215         psp[2].hInstance = GetFtpInst();\r
216         psp[2].pszTemplate = MAKEINTRESOURCE(opt_trmode2_dlg);\r
217         psp[2].pszIcon = NULL;\r
218         psp[2].pfnDlgProc = Trmode2SettingProc;\r
219         psp[2].pszTitle = MSGJPN188;\r
220         psp[2].lParam = 0;\r
221         psp[2].pfnCallback = NULL;\r
222 \r
223         psp[3].dwSize = sizeof(PROPSHEETPAGE);\r
224         psp[3].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
225         psp[3].hInstance = GetFtpInst();\r
226         psp[3].pszTemplate = MAKEINTRESOURCE(opt_trmode3_dlg);\r
227         psp[3].pszIcon = NULL;\r
228         psp[3].pfnDlgProc = Trmode3SettingProc;\r
229         psp[3].pszTitle = MSGJPN189;\r
230         psp[3].lParam = 0;\r
231         psp[3].pfnCallback = NULL;\r
232 \r
233         psp[4].dwSize = sizeof(PROPSHEETPAGE);\r
234         psp[4].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
235         psp[4].hInstance = GetFtpInst();\r
236         psp[4].pszTemplate = MAKEINTRESOURCE(opt_mirror_dlg);\r
237         psp[4].pszIcon = NULL;\r
238         psp[4].pfnDlgProc = MirrorSettingProc;\r
239         psp[4].pszTitle = MSGJPN190;\r
240         psp[4].lParam = 0;\r
241         psp[4].pfnCallback = NULL;\r
242 \r
243         psp[5].dwSize = sizeof(PROPSHEETPAGE);\r
244         psp[5].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
245         psp[5].hInstance = GetFtpInst();\r
246         psp[5].pszTemplate = MAKEINTRESOURCE(opt_notify_dlg);\r
247         psp[5].pszIcon = NULL;\r
248         psp[5].pfnDlgProc = NotifySettingProc;\r
249         psp[5].pszTitle = MSGJPN191;\r
250         psp[5].lParam = 0;\r
251         psp[5].pfnCallback = NULL;\r
252 \r
253         psp[6].dwSize = sizeof(PROPSHEETPAGE);\r
254         psp[6].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
255         psp[6].hInstance = GetFtpInst();\r
256         psp[6].pszTemplate = MAKEINTRESOURCE(opt_disp_dlg);\r
257         psp[6].pszIcon = NULL;\r
258         psp[6].pfnDlgProc = DispSettingProc;\r
259         psp[6].pszTitle = MSGJPN192;\r
260         psp[6].lParam = 0;\r
261         psp[6].pfnCallback = NULL;\r
262 \r
263         psp[7].dwSize = sizeof(PROPSHEETPAGE);\r
264         psp[7].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
265         psp[7].hInstance = GetFtpInst();\r
266         psp[7].pszTemplate = MAKEINTRESOURCE(opt_connect_dlg);\r
267         psp[7].pszIcon = NULL;\r
268         psp[7].pfnDlgProc = ConnectSettingProc;\r
269         psp[7].pszTitle = MSGJPN193;\r
270         psp[7].lParam = 0;\r
271         psp[7].pfnCallback = NULL;\r
272 \r
273         psp[8].dwSize = sizeof(PROPSHEETPAGE);\r
274         psp[8].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
275         psp[8].hInstance = GetFtpInst();\r
276         psp[8].pszTemplate = MAKEINTRESOURCE(opt_fire_dlg);\r
277         psp[8].pszIcon = NULL;\r
278         psp[8].pfnDlgProc = FireSettingProc;\r
279         psp[8].pszTitle = MSGJPN194;\r
280         psp[8].lParam = 0;\r
281         psp[8].pfnCallback = NULL;\r
282 \r
283         psp[9].dwSize = sizeof(PROPSHEETPAGE);\r
284         psp[9].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
285         psp[9].hInstance = GetFtpInst();\r
286         psp[9].pszTemplate = MAKEINTRESOURCE(opt_tool_dlg);\r
287         psp[9].pszIcon = NULL;\r
288         psp[9].pfnDlgProc = ToolSettingProc;\r
289         psp[9].pszTitle = MSGJPN195;\r
290         psp[9].lParam = 0;\r
291         psp[9].pfnCallback = NULL;\r
292 \r
293         psp[10].dwSize = sizeof(PROPSHEETPAGE);\r
294         psp[10].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
295         psp[10].hInstance = GetFtpInst();\r
296         psp[10].pszTemplate = MAKEINTRESOURCE(opt_sound_dlg);\r
297         psp[10].pszIcon = NULL;\r
298         psp[10].pfnDlgProc = SoundSettingProc;\r
299         psp[10].pszTitle = MSGJPN196;\r
300         psp[10].lParam = 0;\r
301         psp[10].pfnCallback = NULL;\r
302 \r
303         psp[11].dwSize = sizeof(PROPSHEETPAGE);\r
304         psp[11].dwFlags = PSP_USETITLE | PSP_HASHELP;\r
305         psp[11].hInstance = GetFtpInst();\r
306         psp[11].pszTemplate = MAKEINTRESOURCE(opt_misc_dlg);\r
307         psp[11].pszIcon = NULL;\r
308         psp[11].pfnDlgProc = MiscSettingProc;\r
309         psp[11].pszTitle = MSGJPN197;\r
310         psp[11].lParam = 0;\r
311         psp[11].pfnCallback = NULL;\r
312 \r
313         psh.dwSize = sizeof(PROPSHEETHEADER);\r
314         psh.dwFlags = PSH_HASHELP | PSH_NOAPPLYNOW | PSH_PROPSHEETPAGE;\r
315         psh.hwndParent = GetMainHwnd();\r
316         psh.hInstance = GetFtpInst();\r
317         psh.pszIcon = NULL;\r
318         psh.pszCaption = MSGJPN198;\r
319         psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);\r
320         psh.nStartPage = Start;\r
321         psh.ppsp = (LPCPROPSHEETPAGE)&psp;\r
322         psh.pfnCallback = NULL;\r
323 \r
324         PropertySheet(&psh);\r
325         return;\r
326 }\r
327 \r
328 \r
329 /*----- ユーザ設定ウインドウのコールバック ------------------------------------\r
330 *\r
331 *       Parameter\r
332 *               HWND hDlg : ウインドウハンドル\r
333 *               UINT message : メッセージ番号\r
334 *               WPARAM wParam : メッセージの WPARAM 引数\r
335 *               LPARAM lParam : メッセージの LPARAM 引数\r
336 *\r
337 *       Return Value\r
338 *               BOOL TRUE/FALSE\r
339 *----------------------------------------------------------------------------*/\r
340 \r
341 // 64ビット対応\r
342 //static BOOL CALLBACK UserSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
343 static INT_PTR CALLBACK UserSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
344 {\r
345         NMHDR *pnmhdr;\r
346 \r
347         switch (message)\r
348         {\r
349                 case WM_INITDIALOG :\r
350                         SendDlgItemMessage(hDlg, USER_ADRS, EM_LIMITTEXT, PASSWORD_LEN, 0);\r
351                         SendDlgItemMessage(hDlg, USER_ADRS, WM_SETTEXT, 0, (LPARAM)UserMailAdrs);\r
352                     return(TRUE);\r
353 \r
354                 case WM_NOTIFY:\r
355                         pnmhdr = (NMHDR FAR *)lParam;\r
356                         switch(pnmhdr->code)\r
357                         {\r
358                                 case PSN_APPLY :\r
359                                         SendDlgItemMessage(hDlg, USER_ADRS, WM_GETTEXT, USER_MAIL_LEN+1, (LPARAM)UserMailAdrs);\r
360                                         break;\r
361 \r
362                                 case PSN_RESET :\r
363                                         break;\r
364 \r
365                                 case PSN_HELP :\r
366                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000041);\r
367                                         break;\r
368                         }\r
369                         break;\r
370         }\r
371     return(FALSE);\r
372 }\r
373 \r
374 \r
375 /*----- 転送設定1ウインドウのコールバック ------------------------------------\r
376 *\r
377 *       Parameter\r
378 *               HWND hDlg : ウインドウハンドル\r
379 *               UINT message : メッセージ番号\r
380 *               WPARAM wParam : メッセージの WPARAM 引数\r
381 *               LPARAM lParam : メッセージの LPARAM 引数\r
382 *\r
383 *       Return Value\r
384 *               BOOL TRUE/FALSE\r
385 *----------------------------------------------------------------------------*/\r
386 \r
387 // 64ビット対応\r
388 //static BOOL CALLBACK Trmode1SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
389 static INT_PTR CALLBACK Trmode1SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
390 {\r
391         NMHDR *pnmhdr;\r
392         int Num;\r
393         char Tmp[FMAX_PATH+1];\r
394         int Trash;\r
395 \r
396         static const RADIOBUTTON ModeButton[] = {\r
397                 { TRMODE_AUTO, TYPE_X },\r
398                 { TRMODE_ASCII, TYPE_A },\r
399                 { TRMODE_BIN, TYPE_I }\r
400         };\r
401         #define MODEBUTTONS     (sizeof(ModeButton)/sizeof(RADIOBUTTON))\r
402 \r
403         switch (message)\r
404         {\r
405                 case WM_INITDIALOG :\r
406                         SetMultiTextToList(hDlg, TRMODE_EXT_LIST, AsciiExt);\r
407                         SetRadioButtonByValue(hDlg, AskTransferType(), ModeButton, MODEBUTTONS);\r
408                         SendDlgItemMessage(hDlg, TRMODE_TIME, BM_SETCHECK, SaveTimeStamp, 0);\r
409                         SendDlgItemMessage(hDlg, TRMODE_EOF, BM_SETCHECK, RmEOF, 0);\r
410                         SendDlgItemMessage(hDlg, TRMODE_SEMICOLON, BM_SETCHECK, VaxSemicolon, 0);\r
411                         // ディレクトリ自動作成\r
412                         SendDlgItemMessage(hDlg, TRMODE_MAKEDIR, BM_SETCHECK, MakeAllDir, 0);\r
413 \r
414                         SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(TRMODE_EXT_LIST, 0), 0);\r
415 \r
416                     return(TRUE);\r
417 \r
418                 case WM_NOTIFY:\r
419                         pnmhdr = (NMHDR FAR *)lParam;\r
420                         switch(pnmhdr->code)\r
421                         {\r
422                                 case PSN_APPLY :\r
423                                         SetTransferTypeImm(AskRadioButtonValue(hDlg, ModeButton, MODEBUTTONS));\r
424                                         SaveTransferType();\r
425                                         GetMultiTextFromList(hDlg, TRMODE_EXT_LIST, AsciiExt, ASCII_EXT_LEN+1);\r
426                                         SaveTimeStamp = SendDlgItemMessage(hDlg, TRMODE_TIME, BM_GETCHECK, 0, 0);\r
427                                         RmEOF = SendDlgItemMessage(hDlg, TRMODE_EOF, BM_GETCHECK, 0, 0);\r
428                                         VaxSemicolon = SendDlgItemMessage(hDlg, TRMODE_SEMICOLON, BM_GETCHECK, 0, 0);\r
429                                         // ディレクトリ自動作成\r
430                                         MakeAllDir = SendDlgItemMessage(hDlg, TRMODE_MAKEDIR, BM_GETCHECK, 0, 0);\r
431                                         break;\r
432 \r
433                                 case PSN_RESET :\r
434                                         break;\r
435 \r
436                                 case PSN_HELP :\r
437                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000042);\r
438                                         break;\r
439                         }\r
440                         break;\r
441 \r
442                 case WM_COMMAND :\r
443                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
444                         {\r
445                                 case TRMODE_ASCII :\r
446                                 case TRMODE_BIN :\r
447                                         EnableWindow(GetDlgItem(hDlg, TRMODE_EXT_LIST), FALSE);\r
448                                         EnableWindow(GetDlgItem(hDlg, TRMODE_ADD), FALSE);\r
449                                         EnableWindow(GetDlgItem(hDlg, TRMODE_DEL), FALSE);\r
450                                         break;\r
451 \r
452                                 case TRMODE_AUTO :\r
453                                         EnableWindow(GetDlgItem(hDlg, TRMODE_EXT_LIST), TRUE);\r
454                                         EnableWindow(GetDlgItem(hDlg, TRMODE_ADD), TRUE);\r
455                                         EnableWindow(GetDlgItem(hDlg, TRMODE_DEL), TRUE);\r
456                                         break;\r
457 \r
458                                 case TRMODE_ADD :\r
459                                         strcpy(Tmp, "");\r
460                                         if(InputDialogBox(fname_in_dlg, hDlg, MSGJPN199, Tmp, FMAX_PATH, &Trash, IDH_HELP_TOPIC_0000001) == YES)\r
461                                                 AddTextToListBox(hDlg, Tmp,  TRMODE_EXT_LIST, ASCII_EXT_LEN+1);\r
462                                         break;\r
463 \r
464                                 case TRMODE_DEL :\r
465                                         if((Num = SendDlgItemMessage(hDlg, TRMODE_EXT_LIST, LB_GETCURSEL, 0, 0)) != LB_ERR)\r
466                                                 SendDlgItemMessage(hDlg, TRMODE_EXT_LIST, LB_DELETESTRING, Num, 0);\r
467                                         break;\r
468                         }\r
469                         return(TRUE);\r
470         }\r
471     return(FALSE);\r
472 }\r
473 \r
474 \r
475 /*----- 転送設定2ウインドウのコールバック ------------------------------------\r
476 *\r
477 *       Parameter\r
478 *               HWND hDlg : ウインドウハンドル\r
479 *               UINT message : メッセージ番号\r
480 *               WPARAM wParam : メッセージの WPARAM 引数\r
481 *               LPARAM lParam : メッセージの LPARAM 引数\r
482 *\r
483 *       Return Value\r
484 *               BOOL TRUE/FALSE\r
485 *----------------------------------------------------------------------------*/\r
486 \r
487 // 64ビット対応\r
488 //static BOOL CALLBACK Trmode2SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
489 static INT_PTR CALLBACK Trmode2SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
490 {\r
491         NMHDR *pnmhdr;\r
492         char Tmp[FMAX_PATH+1];\r
493 \r
494         static const RADIOBUTTON CnvButton[] = {\r
495                 { TRMODE2_NOCNV, FNAME_NOCNV },\r
496                 { TRMODE2_LOWER, FNAME_LOWER },\r
497                 { TRMODE2_UPPER, FNAME_UPPER }\r
498         };\r
499         #define CNVBUTTONS      (sizeof(CnvButton)/sizeof(RADIOBUTTON))\r
500 \r
501         switch (message)\r
502         {\r
503                 case WM_INITDIALOG :\r
504                         SendDlgItemMessage(hDlg, TRMODE2_LOCAL, EM_LIMITTEXT, FMAX_PATH, 0);\r
505                         SendDlgItemMessage(hDlg, TRMODE2_LOCAL, WM_SETTEXT, 0, (LPARAM)DefaultLocalPath);\r
506 \r
507                         SetRadioButtonByValue(hDlg, FnameCnv, CnvButton, CNVBUTTONS);\r
508 \r
509                         SendDlgItemMessage(hDlg, TRMODE2_TIMEOUT, EM_LIMITTEXT, (WPARAM)5, 0);\r
510                         sprintf(Tmp, "%d", TimeOut);\r
511                         SendDlgItemMessage(hDlg, TRMODE2_TIMEOUT, WM_SETTEXT, 0, (LPARAM)Tmp);\r
512                         SendDlgItemMessage(hDlg, TRMODE2_TIMEOUT_SPN, UDM_SETRANGE, 0, MAKELONG(300, 0));\r
513                     return(TRUE);\r
514 \r
515                 case WM_NOTIFY:\r
516                         pnmhdr = (NMHDR FAR *)lParam;\r
517                         switch(pnmhdr->code)\r
518                         {\r
519                                 case PSN_APPLY :\r
520                                         SendDlgItemMessage(hDlg, TRMODE2_LOCAL, WM_GETTEXT, FMAX_PATH+1, (LPARAM)DefaultLocalPath);\r
521 \r
522                                         FnameCnv = AskRadioButtonValue(hDlg, CnvButton, CNVBUTTONS);\r
523 \r
524                                         SendDlgItemMessage(hDlg, TRMODE2_TIMEOUT, WM_GETTEXT, 5+1, (LPARAM)Tmp);\r
525                                         TimeOut = atoi(Tmp);\r
526                                         CheckRange2(&TimeOut, 300, 0);\r
527                                         break;\r
528 \r
529                                 case PSN_RESET :\r
530                                         break;\r
531 \r
532                                 case PSN_HELP :\r
533                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000043);\r
534                                         break;\r
535                         }\r
536                         break;\r
537 \r
538                 case WM_COMMAND :\r
539                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
540                         {\r
541                                 case TRMODE2_LOCAL_BR :\r
542                                         if(SelectDir(hDlg, Tmp, FMAX_PATH) == TRUE)\r
543                                                 SendDlgItemMessage(hDlg, TRMODE2_LOCAL, WM_SETTEXT, 0, (LPARAM)Tmp);\r
544                                         break;\r
545                         }\r
546                         return(TRUE);\r
547         }\r
548     return(FALSE);\r
549 }\r
550 \r
551 \r
552 /*----- 転送設定3ウインドウのコールバック ------------------------------------\r
553 *\r
554 *       Parameter\r
555 *               HWND hDlg : ウインドウハンドル\r
556 *               UINT message : メッセージ番号\r
557 *               WPARAM wParam : メッセージの WPARAM 引数\r
558 *               LPARAM lParam : メッセージの LPARAM 引数\r
559 *\r
560 *       Return Value\r
561 *               BOOL TRUE/FALSE\r
562 *----------------------------------------------------------------------------*/\r
563 \r
564 // 64ビット対応\r
565 //static BOOL CALLBACK Trmode3SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
566 static INT_PTR CALLBACK Trmode3SettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
567 {\r
568         NMHDR *pnmhdr;\r
569         LV_COLUMN LvCol;\r
570         long Tmp;\r
571         RECT Rect;\r
572         ATTRSET AttrSet;\r
573         char *Fname;\r
574         char *Attr;\r
575         char TmpStr[10];\r
576 \r
577         switch (message)\r
578         {\r
579                 case WM_INITDIALOG :\r
580                     Tmp = SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);\r
581                     Tmp |= LVS_EX_FULLROWSELECT;\r
582                 SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (LPARAM)Tmp);\r
583 \r
584                         GetClientRect(GetDlgItem(hDlg, TRMODE3_LIST), &Rect);\r
585 \r
586                         LvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;\r
587                         LvCol.cx = (Rect.right / 3) * 2;\r
588                         LvCol.pszText = MSGJPN200;\r
589                         LvCol.iSubItem = 0;\r
590                         SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_INSERTCOLUMN, 0, (LPARAM)&LvCol);\r
591 \r
592                         LvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;\r
593                         LvCol.cx = Rect.right - LvCol.cx;\r
594                         LvCol.pszText = MSGJPN201;\r
595                         LvCol.iSubItem = 1;\r
596                         SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_INSERTCOLUMN, 1, (LPARAM)&LvCol);\r
597 \r
598                         Fname = DefAttrList;\r
599                         while(*Fname != NUL)\r
600                         {\r
601                                 Attr = strchr(Fname, NUL) + 1;\r
602                                 if(*Attr != NUL)\r
603                                         AddFnameAttrToListView(hDlg, Fname, Attr);\r
604                                 Fname = strchr(Attr, NUL) + 1;\r
605                         }\r
606 \r
607                         SendDlgItemMessage(hDlg, TRMODE3_FOLDER, BM_SETCHECK, FolderAttr, 0);\r
608                         if(FolderAttr == NO)\r
609                                 EnableWindow(GetDlgItem(hDlg, TRMODE3_FOLDER_ATTR), FALSE);\r
610 \r
611                         SendDlgItemMessage(hDlg, TRMODE3_FOLDER_ATTR, EM_LIMITTEXT, (WPARAM)5, 0);\r
612                         sprintf(TmpStr, "%03d", FolderAttrNum);\r
613                         SendDlgItemMessage(hDlg, TRMODE3_FOLDER_ATTR, WM_SETTEXT, 0, (LPARAM)TmpStr);\r
614                     return(TRUE);\r
615 \r
616                 case WM_NOTIFY:\r
617                         pnmhdr = (NMHDR FAR *)lParam;\r
618                         switch(pnmhdr->code)\r
619                         {\r
620                                 case PSN_APPLY :\r
621                                         GetFnameAttrFromListView(hDlg, DefAttrList);\r
622                                         SendDlgItemMessage(hDlg, TRMODE3_FOLDER_ATTR, WM_GETTEXT, 5+1, (LPARAM)TmpStr);\r
623                                         FolderAttrNum = atoi(TmpStr);\r
624                                         FolderAttr = SendDlgItemMessage(hDlg, TRMODE3_FOLDER, BM_GETCHECK, 0, 0);\r
625                                         break;\r
626 \r
627                                 case PSN_RESET :\r
628                                         break;\r
629 \r
630                                 case PSN_HELP :\r
631                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000044);\r
632                                         break;\r
633                         }\r
634                         break;\r
635 \r
636                 case WM_COMMAND :\r
637                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
638                         {\r
639                                 case TRMODE3_ADD :\r
640                                         if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(def_attr_dlg), hDlg, DefAttrDlgProc, (LPARAM)&AttrSet) == YES)\r
641                                         {\r
642                                                 if((strlen(AttrSet.Fname) > 0) && (strlen(AttrSet.Attr) > 0))\r
643                                                         AddFnameAttrToListView(hDlg, AttrSet.Fname, AttrSet.Attr);\r
644                                         }\r
645                                         break;\r
646 \r
647                                 case TRMODE3_DEL :\r
648                                         if((Tmp = SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_GETNEXTITEM, -1, MAKELPARAM(LVNI_ALL | LVNI_SELECTED, 0))) != -1)\r
649                                                 SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_DELETEITEM, Tmp, 0);\r
650                                         break;\r
651 \r
652                                 case TRMODE3_FOLDER :\r
653                                         if(SendDlgItemMessage(hDlg, TRMODE3_FOLDER, BM_GETCHECK, 0, 0) == 1)\r
654                                                 EnableWindow(GetDlgItem(hDlg, TRMODE3_FOLDER_ATTR), TRUE);\r
655                                         else\r
656                                                 EnableWindow(GetDlgItem(hDlg, TRMODE3_FOLDER_ATTR), FALSE);\r
657                                         break;\r
658                         }\r
659                         return(TRUE);\r
660         }\r
661     return(FALSE);\r
662 }\r
663 \r
664 \r
665 /*----- ファイル属性設定ウインドウのコールバック ------------------------------\r
666 *\r
667 *       Parameter\r
668 *               HWND hDlg : ウインドウハンドル\r
669 *               UINT message : メッセージ番号\r
670 *               WPARAM wParam : メッセージの WPARAM 引数\r
671 *               LPARAM lParam : メッセージの LPARAM 引数\r
672 *\r
673 *       Return Value\r
674 *               BOOL TRUE/FALSE\r
675 *----------------------------------------------------------------------------*/\r
676 \r
677 // 64ビット対応\r
678 //static BOOL CALLBACK DefAttrDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
679 static INT_PTR CALLBACK DefAttrDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
680 {\r
681         static ATTRSET *AttrSet;\r
682         char Tmp[5];\r
683 \r
684         switch (message)\r
685         {\r
686                 case WM_INITDIALOG :\r
687                         AttrSet = (ATTRSET *)lParam;\r
688                         SendDlgItemMessage(hDlg, DEFATTR_FNAME, EM_LIMITTEXT, (WPARAM)FMAX_PATH, 0);\r
689                         SendDlgItemMessage(hDlg, DEFATTR_ATTR, EM_LIMITTEXT, (WPARAM)4, 0);\r
690                     return(TRUE);\r
691 \r
692                 case WM_COMMAND :\r
693                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
694                         {\r
695                                 case IDOK :\r
696                                         SendDlgItemMessage(hDlg, DEFATTR_FNAME, WM_GETTEXT, (WPARAM)FMAX_PATH+1, (LPARAM)AttrSet->Fname);\r
697                                         SendDlgItemMessage(hDlg, DEFATTR_ATTR, WM_GETTEXT, (WPARAM)4+1, (LPARAM)AttrSet->Attr);\r
698                                         EndDialog(hDlg, YES);\r
699                                         break;\r
700 \r
701                                 case IDCANCEL :\r
702                                         EndDialog(hDlg, NO);\r
703                                         break;\r
704 \r
705                                 case DEFATTR_ATTR_BR :\r
706                                         SendDlgItemMessage(hDlg, DEFATTR_ATTR, WM_GETTEXT, (WPARAM)4+1, (LPARAM)Tmp);\r
707                                         if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(chmod_dlg), GetMainHwnd(), ChmodDialogCallBack, (LPARAM)Tmp) == YES)\r
708                                                 SendDlgItemMessage(hDlg, DEFATTR_ATTR, WM_SETTEXT, 0, (LPARAM)Tmp);\r
709                                         break;\r
710                         }\r
711                         return(TRUE);\r
712         }\r
713     return(FALSE);\r
714 }\r
715 \r
716 \r
717 /*----- ファイル名と属性をリストビューに追加 ----------------------------------\r
718 *\r
719 *       Parameter\r
720 *               HWND hDlg : ウインドウハンドル\r
721 *               char *Fname : ファイル名\r
722 *               char *Attr : 属性\r
723 *\r
724 *       Return Value\r
725 *               なし\r
726 *----------------------------------------------------------------------------*/\r
727 \r
728 static void AddFnameAttrToListView(HWND hDlg, char *Fname, char *Attr)\r
729 {\r
730         int Num;\r
731         LV_ITEM LvItem;\r
732         char Buf[DEFATTRLIST_LEN+1];\r
733 \r
734         GetFnameAttrFromListView(hDlg, Buf);\r
735         if(StrMultiLen(Buf) + strlen(Fname) + strlen(Attr) + 2 <= DEFATTRLIST_LEN)\r
736         {\r
737                 Num = SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_GETITEMCOUNT, 0, 0);\r
738 \r
739                 LvItem.mask = LVIF_TEXT;\r
740                 LvItem.iItem = Num;\r
741                 LvItem.iSubItem = 0;\r
742                 LvItem.pszText = Fname;\r
743                 SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_INSERTITEM, 0, (LPARAM)&LvItem);\r
744 \r
745                 LvItem.mask = LVIF_TEXT;\r
746                 LvItem.iItem = Num;\r
747                 LvItem.iSubItem = 1;\r
748                 LvItem.pszText = Attr;\r
749                 SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_SETITEM, 0, (LPARAM)&LvItem);\r
750         }\r
751         else\r
752                 MessageBeep(-1);\r
753 \r
754         return;\r
755 }\r
756 \r
757 \r
758 /*----- リストビューの内容をマルチ文字列にする --------------------------------\r
759 *\r
760 *       Parameter\r
761 *               HWND hDlg : ダイアログボックスのウインドウハンドル\r
762 *               int CtrlList : リストボックスのID\r
763 *               char *Buf : 文字列をセットするバッファ\r
764 *               int BufSize : バッファのサイズ\r
765 *\r
766 *       Return Value\r
767 *               なし\r
768 *----------------------------------------------------------------------------*/\r
769 \r
770 static void GetFnameAttrFromListView(HWND hDlg, char *Buf)\r
771 {\r
772         int Num;\r
773         int i;\r
774         LV_ITEM LvItem;\r
775 \r
776         Num = SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_GETITEMCOUNT, 0, 0);\r
777         for(i = 0; i < Num; i++)\r
778         {\r
779                 LvItem.mask = LVIF_TEXT;\r
780                 LvItem.iItem = i;\r
781                 LvItem.iSubItem = 0;\r
782                 LvItem.pszText = Buf;\r
783                 LvItem.cchTextMax = FMAX_PATH;\r
784                 SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_GETITEM, 0, (LPARAM)&LvItem);\r
785                 Buf = strchr(Buf, NUL) + 1;\r
786 \r
787                 LvItem.mask = LVIF_TEXT;\r
788                 LvItem.iItem = i;\r
789                 LvItem.iSubItem = 1;\r
790                 LvItem.pszText = Buf;\r
791                 LvItem.cchTextMax = FMAX_PATH;\r
792                 SendDlgItemMessage(hDlg, TRMODE3_LIST, LVM_GETITEM, 0, (LPARAM)&LvItem);\r
793                 Buf = strchr(Buf, NUL) + 1;\r
794         }\r
795         *Buf = NUL;\r
796 \r
797         return;\r
798 }\r
799 \r
800 \r
801 /*----- ミラーリングウインドウのコールバック ----------------------------------\r
802 *\r
803 *       Parameter\r
804 *               HWND hDlg : ウインドウハンドル\r
805 *               UINT message : メッセージ番号\r
806 *               WPARAM wParam : メッセージの WPARAM 引数\r
807 *               LPARAM lParam : メッセージの LPARAM 引数\r
808 *\r
809 *       Return Value\r
810 *               BOOL TRUE/FALSE\r
811 *----------------------------------------------------------------------------*/\r
812 \r
813 // 64ビット対応\r
814 //static BOOL CALLBACK MirrorSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
815 static INT_PTR CALLBACK MirrorSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
816 {\r
817         NMHDR *pnmhdr;\r
818         int Num;\r
819         char Tmp[FMAX_PATH+1];\r
820         int Trash;\r
821 \r
822         switch (message)\r
823         {\r
824                 case WM_INITDIALOG :\r
825                         SetMultiTextToList(hDlg, MIRROR_NOTRN_LIST, MirrorNoTrn);\r
826                         SetMultiTextToList(hDlg, MIRROR_NODEL_LIST, MirrorNoDel);\r
827                         SendDlgItemMessage(hDlg, MIRROR_LOW, BM_SETCHECK, MirrorFnameCnv, 0);\r
828                         SendDlgItemMessage(hDlg, MIRROR_UPDEL_NOTIFY, BM_SETCHECK, MirUpDelNotify, 0);\r
829                         SendDlgItemMessage(hDlg, MIRROR_DOWNDEL_NOTIFY, BM_SETCHECK, MirDownDelNotify, 0);\r
830                     return(TRUE);\r
831 \r
832                 case WM_NOTIFY:\r
833                         pnmhdr = (NMHDR FAR *)lParam;\r
834                         switch(pnmhdr->code)\r
835                         {\r
836                                 case PSN_APPLY :\r
837                                         GetMultiTextFromList(hDlg, MIRROR_NOTRN_LIST, MirrorNoTrn, MIRROR_LEN+1);\r
838                                         GetMultiTextFromList(hDlg, MIRROR_NODEL_LIST, MirrorNoDel, MIRROR_LEN+1);\r
839                                         MirrorFnameCnv = SendDlgItemMessage(hDlg, MIRROR_LOW, BM_GETCHECK, 0, 0);\r
840                                         MirUpDelNotify = SendDlgItemMessage(hDlg, MIRROR_UPDEL_NOTIFY, BM_GETCHECK, 0, 0);\r
841                                         MirDownDelNotify = SendDlgItemMessage(hDlg, MIRROR_DOWNDEL_NOTIFY, BM_GETCHECK, 0, 0);\r
842                                         break;\r
843 \r
844                                 case PSN_RESET :\r
845                                         break;\r
846 \r
847                                 case PSN_HELP :\r
848                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000045);\r
849                                         break;\r
850                         }\r
851                         break;\r
852 \r
853                 case WM_COMMAND :\r
854                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
855                         {\r
856                                 case MIRROR_NOTRN_ADD :\r
857                                         strcpy(Tmp, "");\r
858                                         if(InputDialogBox(fname_in_dlg, hDlg, MSGJPN202, Tmp, FMAX_PATH, &Trash, IDH_HELP_TOPIC_0000001) == YES)\r
859                                                 AddTextToListBox(hDlg, Tmp, MIRROR_NOTRN_LIST, MIRROR_LEN+1);\r
860                                         break;\r
861 \r
862                                 case MIRROR_NODEL_ADD :\r
863                                         strcpy(Tmp, "");\r
864                                         if(InputDialogBox(fname_in_dlg, hDlg, MSGJPN203, Tmp, FMAX_PATH, &Trash, IDH_HELP_TOPIC_0000001) == YES)\r
865                                                 AddTextToListBox(hDlg, Tmp, MIRROR_NODEL_LIST, MIRROR_LEN+1);\r
866                                         break;\r
867 \r
868                                 case MIRROR_NOTRN_DEL :\r
869                                         if((Num = SendDlgItemMessage(hDlg, MIRROR_NOTRN_LIST, LB_GETCURSEL, 0, 0)) != LB_ERR)\r
870                                                 SendDlgItemMessage(hDlg, MIRROR_NOTRN_LIST, LB_DELETESTRING, Num, 0);\r
871                                         break;\r
872 \r
873                                 case MIRROR_NODEL_DEL :\r
874                                         if((Num = SendDlgItemMessage(hDlg, MIRROR_NODEL_LIST, LB_GETCURSEL, 0, 0)) != LB_ERR)\r
875                                                 SendDlgItemMessage(hDlg, MIRROR_NODEL_LIST, LB_DELETESTRING, Num, 0);\r
876                                         break;\r
877                         }\r
878                         return(TRUE);\r
879         }\r
880     return(FALSE);\r
881 }\r
882 \r
883 \r
884 /*----- 操作設定ウインドウのコールバック --------------------------------------\r
885 *\r
886 *       Parameter\r
887 *               HWND hDlg : ウインドウハンドル\r
888 *               UINT message : メッセージ番号\r
889 *               WPARAM wParam : メッセージの WPARAM 引数\r
890 *               LPARAM lParam : メッセージの LPARAM 引数\r
891 *\r
892 *       Return Value\r
893 *               BOOL TRUE/FALSE\r
894 *----------------------------------------------------------------------------*/\r
895 \r
896 // 64ビット対応\r
897 //static BOOL CALLBACK NotifySettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
898 static INT_PTR CALLBACK NotifySettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
899 {\r
900         NMHDR *pnmhdr;\r
901 \r
902         static const RADIOBUTTON DownButton[] = {\r
903                 { NOTIFY_D_DLG, TRANS_DLG },\r
904                 { NOTIFY_D_OVW, TRANS_OVW }\r
905         };\r
906         #define DOWNBUTTONS     (sizeof(DownButton)/sizeof(RADIOBUTTON))\r
907 \r
908         static const RADIOBUTTON UpButton[] = {\r
909                 { NOTIFY_U_DLG, TRANS_DLG },\r
910                 { NOTIFY_U_OVW, TRANS_OVW }\r
911         };\r
912         #define UPBUTTONS       (sizeof(UpButton)/sizeof(RADIOBUTTON))\r
913 \r
914         static const RADIOBUTTON DclickButton[] = {\r
915                 { NOTIFY_OPEN,     YES },\r
916                 { NOTIFY_DOWNLOAD, NO }\r
917         };\r
918         #define DCLICKBUTTONS   (sizeof(DclickButton)/sizeof(RADIOBUTTON))\r
919 \r
920         static const RADIOBUTTON MoveButton[] = {\r
921                 { NOTIFY_M_NODLG,   MOVE_NODLG },\r
922                 { NOTIFY_M_DLG,     MOVE_DLG },\r
923                 { NOTIFY_M_DISABLE, MOVE_DISABLE }\r
924         };\r
925         #define MOVEBUTTONS     (sizeof(MoveButton)/sizeof(RADIOBUTTON))\r
926 \r
927         switch (message)\r
928         {\r
929                 case WM_INITDIALOG :\r
930                         SetRadioButtonByValue(hDlg, RecvMode,   DownButton,   DOWNBUTTONS);\r
931                         SetRadioButtonByValue(hDlg, SendMode,   UpButton,     UPBUTTONS);\r
932                         SetRadioButtonByValue(hDlg, DclickOpen, DclickButton, DCLICKBUTTONS);\r
933                         SetRadioButtonByValue(hDlg, MoveMode,   MoveButton,   MOVEBUTTONS);\r
934                     return(TRUE);\r
935 \r
936                 case WM_NOTIFY:\r
937                         pnmhdr = (NMHDR FAR *)lParam;\r
938                         switch(pnmhdr->code)\r
939                         {\r
940                                 case PSN_APPLY :\r
941                                         RecvMode   = AskRadioButtonValue(hDlg, DownButton,   DOWNBUTTONS);\r
942                                         SendMode   = AskRadioButtonValue(hDlg, UpButton,     UPBUTTONS);\r
943                                         DclickOpen = AskRadioButtonValue(hDlg, DclickButton, DCLICKBUTTONS);\r
944                                         MoveMode   = AskRadioButtonValue(hDlg, MoveButton,   MOVEBUTTONS);\r
945                                         break;\r
946 \r
947                                 case PSN_RESET :\r
948                                         break;\r
949 \r
950                                 case PSN_HELP :\r
951                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000046);\r
952                                         break;\r
953                         }\r
954                         break;\r
955         }\r
956     return(FALSE);\r
957 }\r
958 \r
959 \r
960 /*----- 表示設定ウインドウのコールバック --------------------------------------\r
961 *\r
962 *       Parameter\r
963 *               HWND hDlg : ウインドウハンドル\r
964 *               UINT message : メッセージ番号\r
965 *               WPARAM wParam : メッセージの WPARAM 引数\r
966 *               LPARAM lParam : メッセージの LPARAM 引数\r
967 *\r
968 *       Return Value\r
969 *               BOOL TRUE/FALSE\r
970 *----------------------------------------------------------------------------*/\r
971 \r
972 // 64ビット対応\r
973 //static BOOL CALLBACK DispSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
974 static INT_PTR CALLBACK DispSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
975 {\r
976         NMHDR *pnmhdr;\r
977         static LOGFONT TmpFont;\r
978 \r
979         switch (message)\r
980         {\r
981                 case WM_INITDIALOG :\r
982                         memcpy(&TmpFont, &ListLogFont, sizeof(LOGFONT));\r
983                         if(ListFont != NULL)\r
984                                 SendDlgItemMessage(hDlg, DISP_FONT, WM_SETTEXT, 0, (LPARAM)TmpFont.lfFaceName);\r
985                         SendDlgItemMessage(hDlg, DISP_HIDE, BM_SETCHECK, DispIgnoreHide, 0);\r
986                         SendDlgItemMessage(hDlg, DISP_DRIVE, BM_SETCHECK, DispDrives, 0);\r
987                         // ファイルアイコン表示対応\r
988                         SendDlgItemMessage(hDlg, DISP_ICON, BM_SETCHECK, DispFileIcon, 0);\r
989                     return(TRUE);\r
990 \r
991                 case WM_NOTIFY:\r
992                         pnmhdr = (NMHDR FAR *)lParam;\r
993                         switch(pnmhdr->code)\r
994                         {\r
995                                 case PSN_APPLY :\r
996                                         DispIgnoreHide = SendDlgItemMessage(hDlg, DISP_HIDE, BM_GETCHECK, 0, 0);\r
997                                         DispDrives = SendDlgItemMessage(hDlg, DISP_DRIVE, BM_GETCHECK, 0, 0);\r
998                                         // ファイルアイコン表示対応\r
999                                         DispFileIcon = SendDlgItemMessage(hDlg, DISP_ICON, BM_GETCHECK, 0, 0);\r
1000                                         if(strlen(TmpFont.lfFaceName) > 0)\r
1001                                         {\r
1002                                                 memcpy(&ListLogFont, &TmpFont, sizeof(LOGFONT));\r
1003                                                 ListFont = CreateFontIndirect(&ListLogFont);\r
1004                                         }\r
1005                                         break;\r
1006 \r
1007                                 case PSN_RESET :\r
1008                                         break;\r
1009 \r
1010                                 case PSN_HELP :\r
1011                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000047);\r
1012                                         break;\r
1013                         }\r
1014                         break;\r
1015 \r
1016                 case WM_COMMAND :\r
1017                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1018                         {\r
1019                                 case DISP_FONT_BR :\r
1020                                         if(SelectListFont(hDlg, &TmpFont) == YES)\r
1021                                                 SendDlgItemMessage(hDlg, DISP_FONT, WM_SETTEXT, 0, (LPARAM)TmpFont.lfFaceName);\r
1022                                         break;\r
1023                         }\r
1024                         return(TRUE);\r
1025         }\r
1026     return(FALSE);\r
1027 }\r
1028 \r
1029 \r
1030 /*----- フォントを選ぶ --------------------------------------------------------\r
1031 *\r
1032 *       Parameter\r
1033 *               HWND hWnd : ウインドウハンドル\r
1034 *               LOGFONT *lFont : フォント情報\r
1035 *\r
1036 *       Return Value\r
1037 *               なし\r
1038 *\r
1039 *       Parameter change\r
1040 *               HFONT *hFont : フォントのハンドル\r
1041 *               LOGFONT *lFont : フォント情報\r
1042 *----------------------------------------------------------------------------*/\r
1043 \r
1044 static int SelectListFont(HWND hWnd, LOGFONT *lFont)\r
1045 {\r
1046         static CHOOSEFONT cFont;\r
1047         int Sts;\r
1048 \r
1049         cFont.lStructSize = sizeof(CHOOSEFONT);\r
1050         cFont.hwndOwner = hWnd;\r
1051         cFont.hDC = 0;\r
1052         cFont.lpLogFont = lFont;\r
1053         cFont.Flags = CF_FORCEFONTEXIST | CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT;\r
1054         cFont.nFontType = SCREEN_FONTTYPE;\r
1055 \r
1056         Sts = NO;\r
1057         if(ChooseFont(&cFont) == TRUE)\r
1058                 Sts = YES;\r
1059 \r
1060         return(Sts);\r
1061 }\r
1062 \r
1063 \r
1064 /*----- 接続/切断設定ウインドウのコールバック --------------------------------\r
1065 *\r
1066 *       Parameter\r
1067 *               HWND hDlg : ウインドウハンドル\r
1068 *               UINT message : メッセージ番号\r
1069 *               WPARAM wParam : メッセージの WPARAM 引数\r
1070 *               LPARAM lParam : メッセージの LPARAM 引数\r
1071 *\r
1072 *       Return Value\r
1073 *               BOOL TRUE/FALSE\r
1074 *----------------------------------------------------------------------------*/\r
1075 \r
1076 // 64ビット対応\r
1077 //static BOOL CALLBACK ConnectSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1078 static INT_PTR CALLBACK ConnectSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1079 {\r
1080         NMHDR *pnmhdr;\r
1081 \r
1082         switch (message)\r
1083         {\r
1084                 case WM_INITDIALOG :\r
1085                         SendDlgItemMessage(hDlg, CONNECT_CONNECT, BM_SETCHECK, ConnectOnStart, 0);\r
1086                         SendDlgItemMessage(hDlg, CONNECT_OLDDLG, BM_SETCHECK, ConnectAndSet, 0);\r
1087                         SendDlgItemMessage(hDlg, CONNECT_RASCLOSE, BM_SETCHECK, RasClose, 0);\r
1088                         if(AskRasUsable() == NO)\r
1089                                 EnableWindow(GetDlgItem(hDlg, CONNECT_RASCLOSE), FALSE);\r
1090                         SendDlgItemMessage(hDlg, CONNECT_CLOSE_NOTIFY, BM_SETCHECK, RasCloseNotify, 0);\r
1091                         if((RasClose == NO) || (AskRasUsable() == NO))\r
1092                                 EnableWindow(GetDlgItem(hDlg, CONNECT_CLOSE_NOTIFY), FALSE);\r
1093                         SendDlgItemMessage(hDlg, CONNECT_HIST, EM_LIMITTEXT, (WPARAM)2, 0);\r
1094                         SetDecimalText(hDlg, CONNECT_HIST, FileHist);\r
1095                         SendDlgItemMessage(hDlg, CONNECT_HIST_SPN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(HISTORY_MAX, 0));\r
1096                         SendDlgItemMessage(hDlg, CONNECT_QUICK_ANONY, BM_SETCHECK, QuickAnonymous, 0);\r
1097                         SendDlgItemMessage(hDlg, CONNECT_HIST_PASS, BM_SETCHECK, PassToHist, 0);\r
1098                         SendDlgItemMessage(hDlg, CONNECT_SENDQUIT, BM_SETCHECK, SendQuit, 0);\r
1099                         SendDlgItemMessage(hDlg, CONNECT_NORAS, BM_SETCHECK, NoRasControl, 0);\r
1100                     return(TRUE);\r
1101 \r
1102                 case WM_NOTIFY:\r
1103                         pnmhdr = (NMHDR FAR *)lParam;\r
1104                         switch(pnmhdr->code)\r
1105                         {\r
1106                                 case PSN_APPLY :\r
1107                                         ConnectOnStart = SendDlgItemMessage(hDlg, MISC_CONNECT, BM_GETCHECK, 0, 0);\r
1108                                         ConnectAndSet = SendDlgItemMessage(hDlg, MISC_OLDDLG, BM_GETCHECK, 0, 0);\r
1109                                         RasClose = SendDlgItemMessage(hDlg, CONNECT_RASCLOSE, BM_GETCHECK, 0, 0);\r
1110                                         RasCloseNotify = SendDlgItemMessage(hDlg, CONNECT_CLOSE_NOTIFY, BM_GETCHECK, 0, 0);\r
1111                                         FileHist = GetDecimalText(hDlg, CONNECT_HIST);\r
1112                                         CheckRange2(&FileHist, HISTORY_MAX, 0);\r
1113                                         QuickAnonymous = SendDlgItemMessage(hDlg, CONNECT_QUICK_ANONY, BM_GETCHECK, 0, 0);\r
1114                                         PassToHist = SendDlgItemMessage(hDlg, CONNECT_HIST_PASS, BM_GETCHECK, 0, 0);\r
1115                                         SendQuit = SendDlgItemMessage(hDlg, CONNECT_SENDQUIT, BM_GETCHECK, 0, 0);\r
1116                                         NoRasControl = SendDlgItemMessage(hDlg, CONNECT_NORAS, BM_GETCHECK, 0, 0);\r
1117                                         break;\r
1118 \r
1119                                 case PSN_RESET :\r
1120                                         break;\r
1121 \r
1122                                 case PSN_HELP :\r
1123                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000048);\r
1124                                         break;\r
1125                         }\r
1126                         break;\r
1127 \r
1128                 case WM_COMMAND :\r
1129                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1130                         {\r
1131                                 case CONNECT_RASCLOSE :\r
1132                                         if(SendDlgItemMessage(hDlg, CONNECT_RASCLOSE, BM_GETCHECK, 0, 0) == 1)\r
1133                                                 EnableWindow(GetDlgItem(hDlg, CONNECT_CLOSE_NOTIFY), TRUE);\r
1134                                         else\r
1135                                                 EnableWindow(GetDlgItem(hDlg, CONNECT_CLOSE_NOTIFY), FALSE);\r
1136                                         break;\r
1137                         }\r
1138                         return(TRUE);\r
1139         }\r
1140     return(FALSE);\r
1141 }\r
1142 \r
1143 \r
1144 /*----- FireWall設定ウインドウのコールバック ----------------------------------\r
1145 *\r
1146 *       Parameter\r
1147 *               HWND hDlg : ウインドウハンドル\r
1148 *               UINT message : メッセージ番号\r
1149 *               WPARAM wParam : メッセージの WPARAM 引数\r
1150 *               LPARAM lParam : メッセージの LPARAM 引数\r
1151 *\r
1152 *       Return Value\r
1153 *               BOOL TRUE/FALSE\r
1154 *----------------------------------------------------------------------------*/\r
1155 \r
1156 // 64ビット対応\r
1157 //static BOOL CALLBACK FireSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1158 static INT_PTR CALLBACK FireSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1159 {\r
1160         NMHDR *pnmhdr;\r
1161         char Tmp[10];\r
1162         int Num;\r
1163         static int Type;\r
1164         static const INTCONVTBL TypeTbl[] = {\r
1165                 { 0, 0 }, { 1, 1 }, { 2, 2 }, { 3, 8 }, \r
1166                 { 4, 3 }, { 5, 4 }, { 6, 5 }, { 7, 6 }, \r
1167                 { 8, 7 }, { 9, 9 }\r
1168         };\r
1169 \r
1170         static const int HideTbl[9][6] = {\r
1171                 { TRUE,  TRUE,  TRUE,  FALSE, TRUE,  FALSE },\r
1172                 { TRUE,  TRUE,  TRUE,  FALSE, FALSE, TRUE  },\r
1173                 { TRUE,  TRUE,  TRUE,  FALSE, FALSE, FALSE },\r
1174                 { FALSE, FALSE, FALSE, FALSE, FALSE, TRUE  },\r
1175                 { FALSE, FALSE, FALSE, FALSE, TRUE,  FALSE },\r
1176                 { TRUE,  FALSE, FALSE, FALSE, FALSE, FALSE },\r
1177                 { FALSE, FALSE, FALSE, TRUE,  FALSE, FALSE },\r
1178                 { TRUE,  TRUE,  FALSE, TRUE,  FALSE, FALSE },\r
1179                 { TRUE,  TRUE,  FALSE, FALSE, TRUE,  TRUE  }\r
1180         };\r
1181 \r
1182         switch (message)\r
1183         {\r
1184                 case WM_INITDIALOG :\r
1185                         Type = ConvertNum(FwallType, 1, TypeTbl, sizeof(TypeTbl)/sizeof(INTCONVTBL));\r
1186                         SendDlgItemMessage(hDlg, FIRE_TYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN204);\r
1187                         SendDlgItemMessage(hDlg, FIRE_TYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN205);\r
1188                         SendDlgItemMessage(hDlg, FIRE_TYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN206);\r
1189                         SendDlgItemMessage(hDlg, FIRE_TYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN207);\r
1190                         SendDlgItemMessage(hDlg, FIRE_TYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN208);\r
1191                         SendDlgItemMessage(hDlg, FIRE_TYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN209);\r
1192                         SendDlgItemMessage(hDlg, FIRE_TYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN210);\r
1193                         SendDlgItemMessage(hDlg, FIRE_TYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN211);\r
1194                         SendDlgItemMessage(hDlg, FIRE_TYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN294);\r
1195                         SendDlgItemMessage(hDlg, FIRE_TYPE, CB_SETCURSEL, Type-1, 0);\r
1196 \r
1197                         SendDlgItemMessage(hDlg, FIRE_HOST, EM_LIMITTEXT, HOST_ADRS_LEN, 0);\r
1198                         SendDlgItemMessage(hDlg, FIRE_USER, EM_LIMITTEXT, USER_NAME_LEN, 0);\r
1199                         SendDlgItemMessage(hDlg, FIRE_PASS, EM_LIMITTEXT, PASSWORD_LEN, 0);\r
1200                         SendDlgItemMessage(hDlg, FIRE_PORT, EM_LIMITTEXT, 5, 0);\r
1201                         SendDlgItemMessage(hDlg, FIRE_DELIMIT, EM_LIMITTEXT, 1, 0);\r
1202 \r
1203                         SendDlgItemMessage(hDlg, FIRE_HOST, WM_SETTEXT, 0, (LPARAM)FwallHost);\r
1204                         SendDlgItemMessage(hDlg, FIRE_USER, WM_SETTEXT, 0, (LPARAM)FwallUser);\r
1205                         SendDlgItemMessage(hDlg, FIRE_PASS, WM_SETTEXT, 0, (LPARAM)FwallPass);\r
1206                         sprintf(Tmp, "%d", FwallPort);\r
1207                         SendDlgItemMessage(hDlg, FIRE_PORT, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1208                         sprintf(Tmp, "%c", FwallDelimiter);\r
1209                         SendDlgItemMessage(hDlg, FIRE_DELIMIT, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1210 \r
1211                         SendDlgItemMessage(hDlg, FIRE_USEIT, BM_SETCHECK, FwallDefault, 0);\r
1212                         SendDlgItemMessage(hDlg, FIRE_PASV, BM_SETCHECK, PasvDefault, 0);\r
1213                         SendDlgItemMessage(hDlg, FIRE_RESOLV, BM_SETCHECK, FwallResolv, 0);\r
1214                         SendDlgItemMessage(hDlg, FIRE_LOWER, BM_SETCHECK, FwallLower, 0);\r
1215 \r
1216                         SendDlgItemMessage(hDlg, FIRE_SECURITY, CB_ADDSTRING, 0, (LPARAM)MSGJPN212);\r
1217                         SendDlgItemMessage(hDlg, FIRE_SECURITY, CB_ADDSTRING, 0, (LPARAM)MSGJPN213);\r
1218                         SendDlgItemMessage(hDlg, FIRE_SECURITY, CB_ADDSTRING, 0, (LPARAM)MSGJPN214);\r
1219                         SendDlgItemMessage(hDlg, FIRE_SECURITY, CB_ADDSTRING, 0, (LPARAM)MSGJPN215);\r
1220                         SendDlgItemMessage(hDlg, FIRE_SECURITY, CB_ADDSTRING, 0, (LPARAM)MSGJPN216);\r
1221                         SendDlgItemMessage(hDlg, FIRE_SECURITY, CB_SETCURSEL, FwallSecurity, 0);\r
1222                     return(TRUE);\r
1223 \r
1224                 case WM_NOTIFY:\r
1225                         pnmhdr = (NMHDR FAR *)lParam;\r
1226                         switch(pnmhdr->code)\r
1227                         {\r
1228                                 case PSN_APPLY :\r
1229                                         Type = SendDlgItemMessage(hDlg, FIRE_TYPE, CB_GETCURSEL, 0, 0) + 1;\r
1230                                         FwallType = ConvertNum(Type, 0, TypeTbl, sizeof(TypeTbl)/sizeof(INTCONVTBL));\r
1231                                         SendDlgItemMessage(hDlg, FIRE_HOST, WM_GETTEXT, HOST_ADRS_LEN+1, (LPARAM)FwallHost);\r
1232                                         SendDlgItemMessage(hDlg, FIRE_USER, WM_GETTEXT, USER_NAME_LEN+1, (LPARAM)FwallUser);\r
1233                                         SendDlgItemMessage(hDlg, FIRE_PASS, WM_GETTEXT, PASSWORD_LEN, (LPARAM)FwallPass);\r
1234                                         SendDlgItemMessage(hDlg, FIRE_PORT, WM_GETTEXT, 5+1, (LPARAM)Tmp);\r
1235                                         FwallPort = atoi(Tmp);\r
1236                                         SendDlgItemMessage(hDlg, FIRE_DELIMIT, WM_GETTEXT, 5, (LPARAM)Tmp);\r
1237                                         FwallDelimiter = Tmp[0];\r
1238                                         FwallDefault = SendDlgItemMessage(hDlg, FIRE_USEIT, BM_GETCHECK, 0, 0);\r
1239                                         PasvDefault = SendDlgItemMessage(hDlg, FIRE_PASV, BM_GETCHECK, 0, 0);\r
1240                                         FwallResolv = SendDlgItemMessage(hDlg, FIRE_RESOLV, BM_GETCHECK, 0, 0);\r
1241                                         FwallLower = SendDlgItemMessage(hDlg, FIRE_LOWER, BM_GETCHECK, 0, 0);\r
1242                                         FwallSecurity = SendDlgItemMessage(hDlg, FIRE_SECURITY, CB_GETCURSEL, 0, 0);\r
1243                                         break;\r
1244 \r
1245                                 case PSN_RESET :\r
1246                                         break;\r
1247 \r
1248                                 case PSN_HELP :\r
1249                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000049);\r
1250                                         break;\r
1251                         }\r
1252                         break;\r
1253 \r
1254                 case WM_COMMAND :\r
1255                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1256                         {\r
1257                                 case FIRE_TYPE :\r
1258                                         Num = SendDlgItemMessage(hDlg, FIRE_TYPE, CB_GETCURSEL, 0, 0);\r
1259                                         EnableWindow(GetDlgItem(hDlg, FIRE_USER), HideTbl[Num][0]);\r
1260                                         EnableWindow(GetDlgItem(hDlg, FIRE_PASS), HideTbl[Num][1]);\r
1261                                         EnableWindow(GetDlgItem(hDlg, FIRE_SECURITY), HideTbl[Num][2]);\r
1262                                         EnableWindow(GetDlgItem(hDlg, FIRE_RESOLV), HideTbl[Num][3]);\r
1263                                         EnableWindow(GetDlgItem(hDlg, FIRE_LOWER), HideTbl[Num][4]);\r
1264                                         EnableWindow(GetDlgItem(hDlg, FIRE_DELIMIT), HideTbl[Num][5]);\r
1265                                         break;\r
1266                         }\r
1267                         return(TRUE);\r
1268         }\r
1269     return(FALSE);\r
1270 }\r
1271 \r
1272 \r
1273 /*----- ツール設定ウインドウのコールバック ------------------------------------\r
1274 *\r
1275 *       Parameter\r
1276 *               HWND hDlg : ウインドウハンドル\r
1277 *               UINT message : メッセージ番号\r
1278 *               WPARAM wParam : メッセージの WPARAM 引数\r
1279 *               LPARAM lParam : メッセージの LPARAM 引数\r
1280 *\r
1281 *       Return Value\r
1282 *               BOOL TRUE/FALSE\r
1283 *----------------------------------------------------------------------------*/\r
1284 \r
1285 // 64ビット対応\r
1286 //static BOOL CALLBACK ToolSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1287 static INT_PTR CALLBACK ToolSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1288 {\r
1289         NMHDR *pnmhdr;\r
1290         char Tmp[FMAX_PATH+1];\r
1291 \r
1292         switch (message)\r
1293         {\r
1294                 case WM_INITDIALOG :\r
1295                         SendDlgItemMessage(hDlg, TOOL_EDITOR1, EM_LIMITTEXT, FMAX_PATH, 0);\r
1296                         SendDlgItemMessage(hDlg, TOOL_EDITOR2, EM_LIMITTEXT, FMAX_PATH, 0);\r
1297                         SendDlgItemMessage(hDlg, TOOL_EDITOR3, EM_LIMITTEXT, FMAX_PATH, 0);\r
1298                         SendDlgItemMessage(hDlg, TOOL_EDITOR1, WM_SETTEXT, 0, (LPARAM)ViewerName[0]);\r
1299                         SendDlgItemMessage(hDlg, TOOL_EDITOR2, WM_SETTEXT, 0, (LPARAM)ViewerName[1]);\r
1300                         SendDlgItemMessage(hDlg, TOOL_EDITOR3, WM_SETTEXT, 0, (LPARAM)ViewerName[2]);\r
1301                     return(TRUE);\r
1302 \r
1303                 case WM_NOTIFY:\r
1304                         pnmhdr = (NMHDR FAR *)lParam;\r
1305                         switch(pnmhdr->code)\r
1306                         {\r
1307                                 case PSN_APPLY :\r
1308                                         SendDlgItemMessage(hDlg, TOOL_EDITOR1, WM_GETTEXT, FMAX_PATH+1, (LPARAM)ViewerName[0]);\r
1309                                         SendDlgItemMessage(hDlg, TOOL_EDITOR2, WM_GETTEXT, FMAX_PATH+1, (LPARAM)ViewerName[1]);\r
1310                                         SendDlgItemMessage(hDlg, TOOL_EDITOR3, WM_GETTEXT, FMAX_PATH+1, (LPARAM)ViewerName[2]);\r
1311                                         break;\r
1312 \r
1313                                 case PSN_RESET :\r
1314                                         break;\r
1315 \r
1316                                 case PSN_HELP :\r
1317                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000050);\r
1318                                         break;\r
1319                         }\r
1320                         break;\r
1321 \r
1322                 case WM_COMMAND :\r
1323                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1324                         {\r
1325                                 case TOOL_EDITOR1_BR :\r
1326                                 case TOOL_EDITOR2_BR :\r
1327                                 case TOOL_EDITOR3_BR :\r
1328                                         strcpy(Tmp, "");\r
1329                                         if(SelectFile(hDlg, Tmp, MSGJPN217, MSGJPN218, NULL, OFN_FILEMUSTEXIST, 0) == TRUE)\r
1330                                         {\r
1331                                                 switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1332                                                 {\r
1333                                                         case TOOL_EDITOR1_BR :\r
1334                                                                 SendDlgItemMessage(hDlg, TOOL_EDITOR1, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1335                                                                 break;\r
1336 \r
1337                                                         case TOOL_EDITOR2_BR :\r
1338                                                                 SendDlgItemMessage(hDlg, TOOL_EDITOR2, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1339                                                                 break;\r
1340 \r
1341                                                         case TOOL_EDITOR3_BR :\r
1342                                                                 SendDlgItemMessage(hDlg, TOOL_EDITOR3, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1343                                                                 break;\r
1344                                                 }\r
1345                                         }\r
1346                                         break;\r
1347                         }\r
1348                         return(TRUE);\r
1349         }\r
1350     return(FALSE);\r
1351 }\r
1352 \r
1353 \r
1354 /*----- サウンド設定ウインドウのコールバック ----------------------------------\r
1355 *\r
1356 *       Parameter\r
1357 *               HWND hDlg : ウインドウハンドル\r
1358 *               UINT message : メッセージ番号\r
1359 *               WPARAM wParam : メッセージの WPARAM 引数\r
1360 *               LPARAM lParam : メッセージの LPARAM 引数\r
1361 *\r
1362 *       Return Value\r
1363 *               BOOL TRUE/FALSE\r
1364 *----------------------------------------------------------------------------*/\r
1365 \r
1366 // 64ビット対応\r
1367 //static BOOL CALLBACK SoundSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1368 static INT_PTR CALLBACK SoundSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1369 {\r
1370         NMHDR *pnmhdr;\r
1371         char Tmp[FMAX_PATH+1];\r
1372 \r
1373         switch (message)\r
1374         {\r
1375                 case WM_INITDIALOG :\r
1376                         SendDlgItemMessage(hDlg, SOUND_CONNECT, BM_SETCHECK, Sound[SND_CONNECT].On, 0);\r
1377                         SendDlgItemMessage(hDlg, SOUND_TRANS, BM_SETCHECK, Sound[SND_TRANS].On, 0);\r
1378                         SendDlgItemMessage(hDlg, SOUND_ERROR, BM_SETCHECK, Sound[SND_ERROR].On, 0);\r
1379 \r
1380                         SendDlgItemMessage(hDlg, SOUND_CONNECT_WAV, EM_LIMITTEXT, (WPARAM)FMAX_PATH, 0);\r
1381                         SendDlgItemMessage(hDlg, SOUND_TRANS_WAV, EM_LIMITTEXT, (WPARAM)FMAX_PATH, 0);\r
1382                         SendDlgItemMessage(hDlg, SOUND_ERROR_WAV, EM_LIMITTEXT, (WPARAM)FMAX_PATH, 0);\r
1383                         SendDlgItemMessage(hDlg, SOUND_CONNECT_WAV, WM_SETTEXT, 0, (LPARAM)Sound[SND_CONNECT].Fname);\r
1384                         SendDlgItemMessage(hDlg, SOUND_TRANS_WAV, WM_SETTEXT, 0, (LPARAM)Sound[SND_TRANS].Fname);\r
1385                         SendDlgItemMessage(hDlg, SOUND_ERROR_WAV, WM_SETTEXT, 0, (LPARAM)Sound[SND_ERROR].Fname);\r
1386                     return(TRUE);\r
1387 \r
1388                 case WM_NOTIFY:\r
1389                         pnmhdr = (NMHDR FAR *)lParam;\r
1390                         switch(pnmhdr->code)\r
1391                         {\r
1392                                 case PSN_APPLY :\r
1393                                         Sound[SND_CONNECT].On = SendDlgItemMessage(hDlg, SOUND_CONNECT, BM_GETCHECK, 0, 0);\r
1394                                         Sound[SND_TRANS].On = SendDlgItemMessage(hDlg, SOUND_TRANS, BM_GETCHECK, 0, 0);\r
1395                                         Sound[SND_ERROR].On = SendDlgItemMessage(hDlg, SOUND_ERROR, BM_GETCHECK, 0, 0);\r
1396                                         SendDlgItemMessage(hDlg, SOUND_CONNECT_WAV, WM_GETTEXT, FMAX_PATH+1, (LPARAM)Sound[SND_CONNECT].Fname);\r
1397                                         SendDlgItemMessage(hDlg, SOUND_TRANS_WAV, WM_GETTEXT, FMAX_PATH+1, (LPARAM)Sound[SND_TRANS].Fname);\r
1398                                         SendDlgItemMessage(hDlg, SOUND_ERROR_WAV, WM_GETTEXT, FMAX_PATH+1, (LPARAM)Sound[SND_ERROR].Fname);\r
1399                                         break;\r
1400 \r
1401                                 case PSN_RESET :\r
1402                                         break;\r
1403 \r
1404                                 case PSN_HELP :\r
1405                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000051);\r
1406                                         break;\r
1407                         }\r
1408                         break;\r
1409 \r
1410                 case WM_COMMAND :\r
1411                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1412                         {\r
1413                                 case SOUND_CONNECT_BR :\r
1414                                 case SOUND_TRANS_BR :\r
1415                                 case SOUND_ERROR_BR :\r
1416                                         strcpy(Tmp, "");\r
1417                                         if(SelectFile(hDlg, Tmp, MSGJPN219, MSGJPN277, NULL, OFN_FILEMUSTEXIST, 0) == TRUE)\r
1418                                         {\r
1419                                                 switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1420                                                 {\r
1421                                                         case SOUND_CONNECT_BR :\r
1422                                                                 SendDlgItemMessage(hDlg, SOUND_CONNECT_WAV, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1423                                                                 break;\r
1424 \r
1425                                                         case SOUND_TRANS_BR :\r
1426                                                                 SendDlgItemMessage(hDlg, SOUND_TRANS_WAV, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1427                                                                 break;\r
1428 \r
1429                                                         case SOUND_ERROR_BR :\r
1430                                                                 SendDlgItemMessage(hDlg, SOUND_ERROR_WAV, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1431                                                                 break;\r
1432                                                 }\r
1433                                         }\r
1434                                         break;\r
1435 \r
1436                                 case SOUND_CONNECT_TEST :\r
1437                                         SendDlgItemMessage(hDlg, SOUND_CONNECT_WAV, WM_GETTEXT, FMAX_PATH+1, (LPARAM)Tmp);\r
1438                                         sndPlaySound(Tmp, SND_ASYNC | SND_NODEFAULT);\r
1439                                         break;\r
1440 \r
1441                                 case SOUND_TRANS_TEST :\r
1442                                         SendDlgItemMessage(hDlg, SOUND_TRANS_WAV, WM_GETTEXT, FMAX_PATH+1, (LPARAM)Tmp);\r
1443                                         sndPlaySound(Tmp, SND_ASYNC | SND_NODEFAULT);\r
1444                                         break;\r
1445 \r
1446                                 case SOUND_ERROR_TEST :\r
1447                                         SendDlgItemMessage(hDlg, SOUND_ERROR_WAV, WM_GETTEXT, FMAX_PATH+1, (LPARAM)Tmp);\r
1448                                         sndPlaySound(Tmp, SND_ASYNC | SND_NODEFAULT);\r
1449                                         break;\r
1450                         }\r
1451                         return(TRUE);\r
1452         }\r
1453     return(FALSE);\r
1454 }\r
1455 \r
1456 \r
1457 /*----- その他の設定ウインドウのコールバック ----------------------------------\r
1458 *\r
1459 *       Parameter\r
1460 *               HWND hDlg : ウインドウハンドル\r
1461 *               UINT message : メッセージ番号\r
1462 *               WPARAM wParam : メッセージの WPARAM 引数\r
1463 *               LPARAM lParam : メッセージの LPARAM 引数\r
1464 *\r
1465 *       Return Value\r
1466 *               BOOL TRUE/FALSE\r
1467 *----------------------------------------------------------------------------*/\r
1468 \r
1469 // 64ビット対応\r
1470 //static BOOL CALLBACK MiscSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1471 static INT_PTR CALLBACK MiscSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1472 {\r
1473         NMHDR *pnmhdr;\r
1474         char Tmp[FMAX_PATH+1];\r
1475 \r
1476         switch (message)\r
1477         {\r
1478                 case WM_INITDIALOG :\r
1479                         SendDlgItemMessage(hDlg, MISC_WINPOS, BM_SETCHECK, SaveWinPos, 0);\r
1480                         SendDlgItemMessage(hDlg, MISC_DEBUG, BM_SETCHECK, DebugConsole, 0);\r
1481                         SendDlgItemMessage(hDlg, MISC_REGTYPE, BM_SETCHECK, RegType, 0);\r
1482 \r
1483                         SendDlgItemMessage(hDlg, MISC_CACHE_SAVE, BM_SETCHECK, CacheSave, 0);\r
1484                         SendDlgItemMessage(hDlg, MISC_BUFNUM, EM_LIMITTEXT, (WPARAM)2, 0);\r
1485                         SetDecimalText(hDlg, MISC_BUFNUM, abs(CacheEntry));\r
1486                         SendDlgItemMessage(hDlg, MISC_BUFNUM_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(99, 1));\r
1487                         if(CacheEntry > 0)\r
1488                         {\r
1489                                 SendDlgItemMessage(hDlg, MISC_CACHE, BM_SETCHECK, 1, 0);\r
1490                                 EnableWindow(GetDlgItem(hDlg, MISC_BUFNUM), TRUE);\r
1491                                 EnableWindow(GetDlgItem(hDlg, MISC_CACHE_SAVE), TRUE);\r
1492                         }\r
1493                         else\r
1494                         {\r
1495                                 SendDlgItemMessage(hDlg, MISC_CACHE, BM_SETCHECK, 0, 0);\r
1496                                 EnableWindow(GetDlgItem(hDlg, MISC_BUFNUM), FALSE);\r
1497                                 EnableWindow(GetDlgItem(hDlg, MISC_CACHE_SAVE), FALSE);\r
1498                         }\r
1499 \r
1500                         SendDlgItemMessage(hDlg, MISC_CACHEDIR, EM_LIMITTEXT, (WPARAM)FMAX_PATH, 0);\r
1501                         SendDlgItemMessage(hDlg, MISC_CACHEDIR, WM_SETTEXT, 0, (LPARAM)TmpPath);\r
1502                     return(TRUE);\r
1503 \r
1504                 case WM_NOTIFY:\r
1505                         pnmhdr = (NMHDR FAR *)lParam;\r
1506                         switch(pnmhdr->code)\r
1507                         {\r
1508                                 case PSN_APPLY :\r
1509                                         SaveWinPos = SendDlgItemMessage(hDlg, MISC_WINPOS, BM_GETCHECK, 0, 0);\r
1510                                         DebugConsole = SendDlgItemMessage(hDlg, MISC_DEBUG, BM_GETCHECK, 0, 0);\r
1511                                         RegType = SendDlgItemMessage(hDlg, MISC_REGTYPE, BM_GETCHECK, 0, 0);\r
1512 \r
1513                                         CacheSave = SendDlgItemMessage(hDlg, MISC_CACHE_SAVE, BM_GETCHECK, 0, 0);\r
1514                                         CacheEntry = GetDecimalText(hDlg, MISC_BUFNUM);\r
1515                                         if(SendDlgItemMessage(hDlg, MISC_CACHE, BM_GETCHECK, 0, 0) == 0)\r
1516                                                 CacheEntry = -CacheEntry;\r
1517 \r
1518                                         SendDlgItemMessage(hDlg, MISC_CACHEDIR, WM_GETTEXT, FMAX_PATH+1, (LPARAM)TmpPath);\r
1519                                         break;\r
1520 \r
1521                                 case PSN_RESET :\r
1522                                         break;\r
1523 \r
1524                                 case PSN_HELP :\r
1525                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000052);\r
1526                                         break;\r
1527                         }\r
1528                         break;\r
1529 \r
1530                 case WM_COMMAND :\r
1531                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1532                         {\r
1533                                 case MISC_CACHE :\r
1534                                         if(SendDlgItemMessage(hDlg, MISC_CACHE, BM_GETCHECK, 0, 0) == 1)\r
1535                                         {\r
1536                                                 EnableWindow(GetDlgItem(hDlg, TRMODE_EXT), TRUE);\r
1537                                                 EnableWindow(GetDlgItem(hDlg, MISC_CACHE_SAVE), TRUE);\r
1538                                         }\r
1539                                         else\r
1540                                         {\r
1541                                                 EnableWindow(GetDlgItem(hDlg, TRMODE_EXT), FALSE);\r
1542                                                 EnableWindow(GetDlgItem(hDlg, MISC_CACHE_SAVE), FALSE);\r
1543                                         }\r
1544                                         break;\r
1545 \r
1546                                 case MISC_CACHEDIR_BR :\r
1547                                         if(SelectDir(hDlg, Tmp, FMAX_PATH) == TRUE)\r
1548                                                 SendDlgItemMessage(hDlg, MISC_CACHEDIR, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1549                                         break;\r
1550 \r
1551                                 case MISC_CACHEDIR_DEF :\r
1552                                         // 環境依存の不具合対策\r
1553 //                                      GetTempPath(FMAX_PATH, Tmp);\r
1554                                         GetAppTempPath(Tmp);\r
1555                                         SetYenTail(Tmp);\r
1556                                         SendDlgItemMessage(hDlg, MISC_CACHEDIR, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1557                                         break;\r
1558                         }\r
1559                         return(TRUE);\r
1560         }\r
1561     return(FALSE);\r
1562 }\r
1563 \r
1564 \r
1565 /*----- ソート設定ウインドウ --------------------------------------------------\r
1566 *\r
1567 *       Parameter\r
1568 *               なし\r
1569 *\r
1570 *       Return Value\r
1571 *               int ステータス (YES=実行/NO=取消)\r
1572 *----------------------------------------------------------------------------*/\r
1573 \r
1574 int SortSetting(void)\r
1575 {\r
1576         int Sts;\r
1577 \r
1578         Sts = DialogBox(GetFtpInst(), MAKEINTRESOURCE(sort_dlg), GetMainHwnd(), SortSettingProc);\r
1579         return(Sts);\r
1580 }\r
1581 \r
1582 \r
1583 /*----- ソート設定ウインドウのコールバック ------------------------------------\r
1584 *\r
1585 *       Parameter\r
1586 *               HWND hDlg : ウインドウハンドル\r
1587 *               UINT message : メッセージ番号\r
1588 *               WPARAM wParam : メッセージの WPARAM 引数\r
1589 *               LPARAM lParam : メッセージの LPARAM 引数\r
1590 *\r
1591 *       Return Value\r
1592 *               BOOL TRUE/FALSE\r
1593 *----------------------------------------------------------------------------*/\r
1594 \r
1595 // 64ビット対応\r
1596 //static BOOL CALLBACK SortSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1597 static INT_PTR CALLBACK SortSettingProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
1598 {\r
1599         int LFsort;\r
1600         int LDsort;\r
1601         int RFsort;\r
1602         int RDsort;\r
1603 \r
1604         static const RADIOBUTTON LsortOrdButton[] = {\r
1605                 { SORT_LFILE_NAME, SORT_NAME },\r
1606                 { SORT_LFILE_EXT, SORT_EXT },\r
1607                 { SORT_LFILE_SIZE, SORT_SIZE },\r
1608                 { SORT_LFILE_DATE, SORT_DATE }\r
1609         };\r
1610         #define LSORTORDBUTTONS (sizeof(LsortOrdButton)/sizeof(RADIOBUTTON))\r
1611 \r
1612         static const RADIOBUTTON LDirsortOrdButton[] = {\r
1613                 { SORT_LDIR_NAME, SORT_NAME },\r
1614                 { SORT_LDIR_DATE, SORT_DATE }\r
1615         };\r
1616         #define LDIRSORTORDBUTTONS      (sizeof(LDirsortOrdButton)/sizeof(RADIOBUTTON))\r
1617 \r
1618         static const RADIOBUTTON RsortOrdButton[] = {\r
1619                 { SORT_RFILE_NAME, SORT_NAME },\r
1620                 { SORT_RFILE_EXT, SORT_EXT },\r
1621                 { SORT_RFILE_SIZE, SORT_SIZE },\r
1622                 { SORT_RFILE_DATE, SORT_DATE }\r
1623         };\r
1624         #define RSORTORDBUTTONS (sizeof(RsortOrdButton)/sizeof(RADIOBUTTON))\r
1625 \r
1626         static const RADIOBUTTON RDirsortOrdButton[] = {\r
1627                 { SORT_RDIR_NAME, SORT_NAME },\r
1628                 { SORT_RDIR_DATE, SORT_DATE }\r
1629         };\r
1630         #define RDIRSORTORDBUTTONS      (sizeof(RDirsortOrdButton)/sizeof(RADIOBUTTON))\r
1631 \r
1632         switch (message)\r
1633         {\r
1634                 case WM_INITDIALOG :\r
1635 \r
1636                         SetRadioButtonByValue(hDlg, AskSortType(ITEM_LFILE) & SORT_MASK_ORD, LsortOrdButton, LSORTORDBUTTONS);\r
1637 \r
1638                         if((AskSortType(ITEM_LFILE) & SORT_GET_ORD) == SORT_ASCENT)\r
1639                                 SendDlgItemMessage(hDlg, SORT_LFILE_REV, BM_SETCHECK, 0, 0);\r
1640                         else\r
1641                                 SendDlgItemMessage(hDlg, SORT_LFILE_REV, BM_SETCHECK, 1, 0);\r
1642 \r
1643                         SetRadioButtonByValue(hDlg, AskSortType(ITEM_LDIR) & SORT_MASK_ORD, LDirsortOrdButton, LDIRSORTORDBUTTONS);\r
1644 \r
1645                         if((AskSortType(ITEM_LDIR) & SORT_GET_ORD) == SORT_ASCENT)\r
1646                                 SendDlgItemMessage(hDlg, SORT_LDIR_REV, BM_SETCHECK, 0, 0);\r
1647                         else\r
1648                                 SendDlgItemMessage(hDlg, SORT_LDIR_REV, BM_SETCHECK, 1, 0);\r
1649 \r
1650                         SetRadioButtonByValue(hDlg, AskSortType(ITEM_RFILE) & SORT_MASK_ORD, RsortOrdButton, RSORTORDBUTTONS);\r
1651 \r
1652                         if((AskSortType(ITEM_RFILE) & SORT_GET_ORD) == SORT_ASCENT)\r
1653                                 SendDlgItemMessage(hDlg, SORT_RFILE_REV, BM_SETCHECK, 0, 0);\r
1654                         else\r
1655                                 SendDlgItemMessage(hDlg, SORT_RFILE_REV, BM_SETCHECK, 1, 0);\r
1656 \r
1657                         SetRadioButtonByValue(hDlg, AskSortType(ITEM_RDIR) & SORT_MASK_ORD, RDirsortOrdButton, RDIRSORTORDBUTTONS);\r
1658 \r
1659                         if((AskSortType(ITEM_RDIR) & SORT_GET_ORD) == SORT_ASCENT)\r
1660                                 SendDlgItemMessage(hDlg, SORT_RDIR_REV, BM_SETCHECK, 0, 0);\r
1661                         else\r
1662                                 SendDlgItemMessage(hDlg, SORT_RDIR_REV, BM_SETCHECK, 1, 0);\r
1663 \r
1664                         SendDlgItemMessage(hDlg, SORT_SAVEHOST, BM_SETCHECK, AskSaveSortToHost(), 0);\r
1665 \r
1666                     return(TRUE);\r
1667 \r
1668                 case WM_COMMAND :\r
1669                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1670                         {\r
1671                                 case IDOK :\r
1672                                         LFsort = AskRadioButtonValue(hDlg, LsortOrdButton, LSORTORDBUTTONS);\r
1673 \r
1674                                         if(SendDlgItemMessage(hDlg, SORT_LFILE_REV, BM_GETCHECK, 0, 0) == 1)\r
1675                                                 LFsort |= SORT_DESCENT;\r
1676 \r
1677                                         LDsort = AskRadioButtonValue(hDlg, LDirsortOrdButton, LDIRSORTORDBUTTONS);\r
1678 \r
1679                                         if(SendDlgItemMessage(hDlg, SORT_LDIR_REV, BM_GETCHECK, 0, 0) == 1)\r
1680                                                 LDsort |= SORT_DESCENT;\r
1681 \r
1682                                         RFsort = AskRadioButtonValue(hDlg, RsortOrdButton, RSORTORDBUTTONS);\r
1683 \r
1684                                         if(SendDlgItemMessage(hDlg, SORT_RFILE_REV, BM_GETCHECK, 0, 0) == 1)\r
1685                                                 RFsort |= SORT_DESCENT;\r
1686 \r
1687                                         RDsort = AskRadioButtonValue(hDlg, RDirsortOrdButton, RDIRSORTORDBUTTONS);\r
1688 \r
1689                                         if(SendDlgItemMessage(hDlg, SORT_RDIR_REV, BM_GETCHECK, 0, 0) == 1)\r
1690                                                 RDsort |= SORT_DESCENT;\r
1691 \r
1692                                         SetSortTypeImm(LFsort, LDsort, RFsort, RDsort);\r
1693 \r
1694                                         SetSaveSortToHost(SendDlgItemMessage(hDlg, SORT_SAVEHOST, BM_GETCHECK, 0, 0));\r
1695 \r
1696                                         EndDialog(hDlg, YES);\r
1697                                         break;\r
1698 \r
1699                                 case IDCANCEL :\r
1700                                         EndDialog(hDlg, NO);\r
1701                                         break;\r
1702         \r
1703                                 case IDHELP :\r
1704                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000001);\r
1705                                         break;\r
1706                 }\r
1707                         return(TRUE);\r
1708         }\r
1709     return(FALSE);\r
1710 }\r
1711 \r
1712 \r
1713 /*----- ダイアログのコントロールから10進数を取得 ----------------------------\r
1714 *\r
1715 *       Parameter\r
1716 *               HWND hDlg : ウインドウハンドル\r
1717 *               int Ctrl : コントロールのID\r
1718 *\r
1719 *       Return Value\r
1720 *               なし\r
1721 *----------------------------------------------------------------------------*/\r
1722 \r
1723 // hostman.cで使用\r
1724 //static int GetDecimalText(HWND hDlg, int Ctrl)\r
1725 int GetDecimalText(HWND hDlg, int Ctrl)\r
1726 {\r
1727         char Tmp[40];\r
1728 \r
1729         SendDlgItemMessage(hDlg, Ctrl, WM_GETTEXT, (WPARAM)39, (LPARAM)Tmp);\r
1730         return(atoi(Tmp));\r
1731 }\r
1732 \r
1733 \r
1734 /*----- ダイアログのコントロールに10進数をセット ----------------------------\r
1735 *\r
1736 *       Parameter\r
1737 *               HWND hDlg : ウインドウハンドル\r
1738 *               int Ctrl : コントロールのID\r
1739 *               int Num : 数値\r
1740 *\r
1741 *       Return Value\r
1742 *               なし\r
1743 *----------------------------------------------------------------------------*/\r
1744 \r
1745 // hostman.cで使用\r
1746 //static void SetDecimalText(HWND hDlg, int Ctrl, int Num)\r
1747 void SetDecimalText(HWND hDlg, int Ctrl, int Num)\r
1748 {\r
1749         char Tmp[40];\r
1750 \r
1751         sprintf(Tmp, "%d", Num);\r
1752         SendDlgItemMessage(hDlg, Ctrl, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1753         return;\r
1754 }\r
1755 \r
1756 \r
1757 /*----- 設定値の範囲チェック --------------------------------------------------\r
1758 *\r
1759 *       Parameter\r
1760 *               int *Cur : 設定値\r
1761 *               int Max : 最大値\r
1762 *               int Min : 最小値\r
1763 *\r
1764 *       Return Value\r
1765 *               なし\r
1766 *\r
1767 *       Parameter change\r
1768 *               int *Cur : 設定値\r
1769 *----------------------------------------------------------------------------*/\r
1770 \r
1771 // hostman.cで使用\r
1772 //static void CheckRange2(int *Cur, int Max, int Min)\r
1773 void CheckRange2(int *Cur, int Max, int Min)\r
1774 {\r
1775         if(*Cur < Min)\r
1776                 *Cur = Min;\r
1777         if(*Cur > Max)\r
1778                 *Cur = Max;\r
1779         return;\r
1780 }\r
1781 \r
1782 \r
1783 /*----- 文字列をリストボックスに追加 ------------------------------------------\r
1784 *\r
1785 *       Parameter\r
1786 *               HWND hDlg : ダイアログボックスのウインドウハンドル\r
1787 *               char *Str : 文字列\r
1788 *               int CtrlList : リストボックスのID\r
1789 *               int BufSize : バッファサイズ\r
1790 *\r
1791 *       Return Value\r
1792 *               なし\r
1793 *----------------------------------------------------------------------------*/\r
1794 \r
1795 // hostman.cで使用\r
1796 //static void AddTextToListBox(HWND hDlg, char *Str, int CtrlList, int BufSize)\r
1797 void AddTextToListBox(HWND hDlg, char *Str, int CtrlList, int BufSize)\r
1798 {\r
1799         char Tmp[FMAX_PATH+1];\r
1800         int Num;\r
1801         int i;\r
1802         int Len;\r
1803 \r
1804         Len = strlen(Str);\r
1805         if(Len > 0)\r
1806         {\r
1807                 Len++;\r
1808                 Num = SendDlgItemMessage(hDlg, CtrlList, LB_GETCOUNT, 0, 0);\r
1809                 for(i = 0; i < Num; i++)\r
1810                 {\r
1811                         SendDlgItemMessage(hDlg, CtrlList, LB_GETTEXT, i, (LPARAM)Tmp);\r
1812                         Len += strlen(Tmp) + 1;\r
1813                 }\r
1814 \r
1815                 if(Len > (BufSize-1))\r
1816                         MessageBeep(-1);\r
1817                 else\r
1818                         SendDlgItemMessage(hDlg, CtrlList, LB_ADDSTRING, 0, (LPARAM)Str);\r
1819         }\r
1820         return;\r
1821 }\r
1822 \r
1823 \r
1824 /*----- マルチ文字列をリストボックスにセット ----------------------------------\r
1825 *\r
1826 *       Parameter\r
1827 *               HWND hDlg : ダイアログボックスのウインドウハンドル\r
1828 *               int CtrlList : リストボックスのID\r
1829 *               char *Text : 文字列\r
1830 *\r
1831 *       Return Value\r
1832 *               なし\r
1833 *----------------------------------------------------------------------------*/\r
1834 \r
1835 // hostman.cで使用\r
1836 //static void SetMultiTextToList(HWND hDlg, int CtrlList, char *Text)\r
1837 void SetMultiTextToList(HWND hDlg, int CtrlList, char *Text)\r
1838 {\r
1839         char *Pos;\r
1840 \r
1841         Pos = Text;\r
1842         while(*Pos != NUL)\r
1843         {\r
1844                 SendDlgItemMessage(hDlg, CtrlList, LB_ADDSTRING, 0, (LPARAM)Pos);\r
1845                 Pos += strlen(Pos) + 1;\r
1846         }\r
1847         return;\r
1848 }\r
1849 \r
1850 \r
1851 /*----- リストボックスの内容をマルチ文字列にする ------------------------------\r
1852 *\r
1853 *       Parameter\r
1854 *               HWND hDlg : ダイアログボックスのウインドウハンドル\r
1855 *               int CtrlList : リストボックスのID\r
1856 *               char *Buf : 文字列をセットするバッファ\r
1857 *               int BufSize : バッファのサイズ\r
1858 *\r
1859 *       Return Value\r
1860 *               なし\r
1861 *----------------------------------------------------------------------------*/\r
1862 \r
1863 // hostman.cで使用\r
1864 //static void GetMultiTextFromList(HWND hDlg, int CtrlList, char *Buf, int BufSize)\r
1865 void GetMultiTextFromList(HWND hDlg, int CtrlList, char *Buf, int BufSize)\r
1866 {\r
1867         char Tmp[FMAX_PATH+1];\r
1868         int Num;\r
1869         int i;\r
1870 \r
1871         memset(Buf, NUL, BufSize);\r
1872         Num = SendDlgItemMessage(hDlg, CtrlList, LB_GETCOUNT, 0, 0);\r
1873         for(i = 0; i < Num; i++)\r
1874         {\r
1875                 SendDlgItemMessage(hDlg, CtrlList, LB_GETTEXT, i, (LPARAM)Tmp);\r
1876                 strcpy(Buf + StrMultiLen(Buf), Tmp);\r
1877         }\r
1878         return;\r
1879 }\r
1880 \r
1881 \r