Open-Source-Software-Entwicklung und Downloads

Browse Subversion Repository

Contents of /trunk/teraterm/teraterm/ttdialog.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3221 - (show annotations) (download) (as text)
Tue Mar 24 09:37:20 2009 UTC (15 years, 2 months ago) by maya
File MIME type: text/x-csrc
File size: 3030 byte(s)
CVS から SVN へ移行: trunk に集約
1 /* Tera Term
2 Copyright(C) 1994-1998 T. Teranishi
3 All rights reserved. */
4
5 /* TERATERM.EXE, TTDLG interface */
6 #include "teraterm.h"
7 #include "tttypes.h"
8 #include "ttplug.h" /* TTPLUG */
9
10 #include "ttdialog.h"
11 #include "ttwinman.h"
12
13 static HMODULE HTTDLG = NULL;
14 static TTDLGUseCount = 0;
15
16 PSetupTerminal SetupTerminal;
17 PSetupWin SetupWin;
18 PSetupKeyboard SetupKeyboard;
19 PSetupSerialPort SetupSerialPort;
20 PSetupTCPIP SetupTCPIP;
21 PGetHostName GetHostName;
22 PChangeDirectory ChangeDirectory;
23 PAboutDialog AboutDialog;
24 PChooseFontDlg ChooseFontDlg;
25 PSetupGeneral SetupGeneral;
26 PWindowWindow WindowWindow;
27
28 #define IdSetupTerminal 1
29 #define IdSetupWin 2
30 #define IdSetupKeyboard 3
31 #define IdSetupSerialPort 4
32 #define IdSetupTCPIP 5
33 #define IdGetHostName 6
34 #define IdChangeDirectory 7
35 #define IdAboutDialog 8
36 #define IdChooseFontDlg 9
37 #define IdSetupGeneral 10
38 #define IdWindowWindow 11
39
40 BOOL LoadTTDLG()
41 {
42 BOOL Err;
43
44 if (HTTDLG == NULL)
45 {
46 TTDLGUseCount = 0;
47
48 HTTDLG = LoadLibrary("TTPDLG.DLL");
49 if (HTTDLG==NULL) return FALSE;
50
51 TTDLGSetUILanguageFile(ts.UILanguageFile);
52
53 Err = FALSE;
54 SetupTerminal = (PSetupTerminal)GetProcAddress(HTTDLG,
55 MAKEINTRESOURCE(IdSetupTerminal));
56 if (SetupTerminal==NULL) Err = TRUE;
57
58 SetupWin = (PSetupWin)GetProcAddress(HTTDLG,
59 MAKEINTRESOURCE(IdSetupWin));
60 if (SetupWin==NULL) Err = TRUE;
61
62 SetupKeyboard = (PSetupKeyboard)GetProcAddress(HTTDLG,
63 MAKEINTRESOURCE(IdSetupKeyboard));
64 if (SetupKeyboard==NULL) Err = TRUE;
65
66 SetupSerialPort = (PSetupSerialPort)GetProcAddress(HTTDLG,
67 MAKEINTRESOURCE(IdSetupSerialPort));
68 if (SetupSerialPort==NULL) Err = TRUE;
69
70 SetupTCPIP = (PSetupTCPIP)GetProcAddress(HTTDLG,
71 MAKEINTRESOURCE(IdSetupTCPIP));
72 if (SetupTCPIP==NULL) Err = TRUE;
73
74 GetHostName = (PGetHostName)GetProcAddress(HTTDLG,
75 MAKEINTRESOURCE(IdGetHostName));
76 if (GetHostName==NULL) Err = TRUE;
77
78 ChangeDirectory = (PChangeDirectory)GetProcAddress(HTTDLG,
79 MAKEINTRESOURCE(IdChangeDirectory));
80 if (ChangeDirectory==NULL) Err = TRUE;
81
82 AboutDialog = (PAboutDialog)GetProcAddress(HTTDLG,
83 MAKEINTRESOURCE(IdAboutDialog));
84 if (AboutDialog==NULL) Err = TRUE;
85
86 ChooseFontDlg = (PChooseFontDlg)GetProcAddress(HTTDLG,
87 MAKEINTRESOURCE(IdChooseFontDlg));
88 if (ChooseFontDlg==NULL) Err = TRUE;
89
90 SetupGeneral = (PSetupGeneral)GetProcAddress(HTTDLG,
91 MAKEINTRESOURCE(IdSetupGeneral));
92 if (SetupGeneral==NULL) Err = TRUE;
93
94 WindowWindow = (PWindowWindow)GetProcAddress(HTTDLG,
95 MAKEINTRESOURCE(IdWindowWindow));
96 if (WindowWindow==NULL) Err = TRUE;
97
98 if (Err)
99 {
100 FreeLibrary(HTTDLG);
101 HTTDLG = NULL;
102 return FALSE;
103 }
104
105 TTXGetUIHooks(); /* TTPLUG */
106 }
107 TTDLGUseCount++;
108 return TRUE;
109 }
110
111 BOOL FreeTTDLG()
112 {
113 if (TTDLGUseCount==0) return FALSE;
114 TTDLGUseCount--;
115 if (TTDLGUseCount>0) return TRUE;
116 if (HTTDLG!=NULL)
117 {
118 FreeLibrary(HTTDLG);
119 HTTDLG = NULL;
120 }
121 return FALSE;
122 }
123

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26