protodlg で PFileVar, PTTSet に依存しないようにした
@@ -663,7 +663,11 @@ | ||
663 | 663 | ProtoVar = NULL; |
664 | 664 | return FALSE; |
665 | 665 | } |
666 | - pd->Create(hInst, HVTWin, fv, &ts); | |
666 | + CProtoDlgInfo info; | |
667 | + info.UILanguageFile = ts.UILanguageFile; | |
668 | + info.HMainWin = fv->HMainWin; | |
669 | + pd->Create(hInst, HVTWin, &info); | |
670 | + fv->HWin = pd->m_hWnd; | |
667 | 671 | |
668 | 672 | (*ProtoInit)(ProtoId,FileVar,ProtoVar,&cv,&ts); |
669 | 673 |
@@ -31,7 +31,7 @@ | ||
31 | 31 | #include "teraterm.h" |
32 | 32 | #include "tt_res.h" |
33 | 33 | #include "tttypes.h" |
34 | -#include "ttftypes.h" | |
34 | +//#include "ttftypes.h" | |
35 | 35 | #include "ttlib.h" |
36 | 36 | #include "dlglib.h" |
37 | 37 | #include "protodlg.h" |
@@ -39,17 +39,16 @@ | ||
39 | 39 | ///////////////////////////////////////////////////////////////////////////// |
40 | 40 | // CProtoDlg dialog |
41 | 41 | |
42 | -BOOL CProtoDlg::Create(HINSTANCE hInstance, HWND hParent, PFileVar pfv, PTTSet pts) | |
42 | +BOOL CProtoDlg::Create(HINSTANCE hInstance, HWND hParent, const CProtoDlgInfo *info) | |
43 | 43 | { |
44 | - m_pts = pts; | |
45 | - fv = pfv; | |
44 | + UILanguageFile = info->UILanguageFile; | |
45 | + HMainWin = info->HMainWin; | |
46 | 46 | |
47 | 47 | BOOL Ok = TTCDialog::Create(hInstance, hParent, IDD_PROTDLG); |
48 | - fv->HWin = GetSafeHwnd(); | |
49 | - | |
50 | 48 | return Ok; |
51 | 49 | } |
52 | 50 | |
51 | + | |
53 | 52 | ///////////////////////////////////////////////////////////////////////////// |
54 | 53 | // CProtoDlg message handler |
55 | 54 |
@@ -63,7 +62,7 @@ | ||
63 | 62 | { IDC_PROT_ELAPSED, "DLG_PROT_ELAPSED" }, |
64 | 63 | { IDCANCEL, "BTN_CANCEL" }, |
65 | 64 | }; |
66 | - SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), m_pts->UILanguageFile); | |
65 | + SetDlgTexts(m_hWnd, TextInfos, _countof(TextInfos), UILanguageFile); | |
67 | 66 | return TRUE; |
68 | 67 | } |
69 | 68 |
@@ -70,7 +69,7 @@ | ||
70 | 69 | |
71 | 70 | BOOL CProtoDlg::OnCancel() |
72 | 71 | { |
73 | - ::PostMessage(fv->HMainWin,WM_USER_PROTOCANCEL,0,0); | |
72 | + ::PostMessage(HMainWin,WM_USER_PROTOCANCEL,0,0); | |
74 | 73 | return TRUE; |
75 | 74 | } |
76 | 75 |
@@ -78,7 +77,7 @@ | ||
78 | 77 | { |
79 | 78 | switch (LOWORD(wParam)) { |
80 | 79 | case IDCANCEL: |
81 | - ::PostMessage(fv->HMainWin,WM_USER_PROTOCANCEL,0,0); | |
80 | + ::PostMessage(HMainWin,WM_USER_PROTOCANCEL,0,0); | |
82 | 81 | return TRUE; |
83 | 82 | default: |
84 | 83 | return (TTCDialog::OnCommand(wParam,lParam)); |
@@ -29,14 +29,19 @@ | ||
29 | 29 | |
30 | 30 | /* TERATERM.EXE, file-transfer-protocol dialog box */ |
31 | 31 | #include "tmfc.h" |
32 | -#include "tttypes.h" | |
33 | 32 | |
34 | 33 | // CProtoDlg dialog |
34 | + | |
35 | +typedef struct { | |
36 | + const char *UILanguageFile; | |
37 | + HWND HMainWin; | |
38 | +} CProtoDlgInfo; | |
39 | + | |
35 | 40 | class CProtoDlg : public TTCDialog |
36 | 41 | { |
37 | 42 | |
38 | 43 | public: |
39 | - BOOL Create(HINSTANCE hInstance, HWND hParent, PFileVar pfv, PTTSet pts); | |
44 | + BOOL Create(HINSTANCE hInstance, HWND hParent, const CProtoDlgInfo *info); | |
40 | 45 | |
41 | 46 | protected: |
42 | 47 | virtual BOOL OnCancel(); |
@@ -44,8 +49,8 @@ | ||
44 | 49 | virtual BOOL OnInitDialog(); |
45 | 50 | virtual BOOL PostNcDestroy(); |
46 | 51 | private: |
47 | - PFileVar fv; | |
48 | - TTTSet *m_pts; | |
52 | + const char *UILanguageFile; | |
53 | + HWND HMainWin; | |
49 | 54 | }; |
50 | 55 | |
51 | 56 | typedef CProtoDlg *PProtoDlg; |