| 73 |
}; |
}; |
| 74 |
|
|
| 75 |
|
|
| 76 |
void PASCAL CopyShmemToTTSet(PTTSet ts) |
void WINAPI CopyShmemToTTSet(PTTSet ts) |
| 77 |
{ |
{ |
| 78 |
// 現在の設定を共有メモリからコピーする |
// 現在の設定を共有メモリからコピーする |
| 79 |
memcpy(ts, &pm->ts, sizeof(TTTSet)); |
memcpy(ts, &pm->ts, sizeof(TTTSet)); |
| 80 |
} |
} |
| 81 |
|
|
| 82 |
void PASCAL CopyTTSetToShmem(PTTSet ts) |
void WINAPI CopyTTSetToShmem(PTTSet ts) |
| 83 |
{ |
{ |
| 84 |
// 現在の設定を共有メモリへコピーする |
// 現在の設定を共有メモリへコピーする |
| 85 |
memcpy(&pm->ts, ts, sizeof(TTTSet)); |
memcpy(&pm->ts, ts, sizeof(TTTSet)); |
| 86 |
} |
} |
| 87 |
|
|
| 88 |
|
|
| 89 |
BOOL PASCAL StartTeraTerm(PTTSet ts) |
BOOL WINAPI StartTeraTerm(PTTSet ts) |
| 90 |
{ |
{ |
| 91 |
char Temp[MAX_PATH]; |
char Temp[MAX_PATH]; |
| 92 |
|
|
| 129 |
|
|
| 130 |
// 設定ファイルをディスクに保存し、Tera Term本体を再起動する。 |
// 設定ファイルをディスクに保存し、Tera Term本体を再起動する。 |
| 131 |
// (2012.4.30 yutaka) |
// (2012.4.30 yutaka) |
| 132 |
void PASCAL RestartTeraTerm(HWND hwnd, PTTSet ts) |
void WINAPI RestartTeraTerm(HWND hwnd, PTTSet ts) |
| 133 |
{ |
{ |
| 134 |
char path[1024]; |
char path[1024]; |
| 135 |
STARTUPINFO si; |
STARTUPINFO si; |
| 162 |
} |
} |
| 163 |
} |
} |
| 164 |
|
|
| 165 |
void PASCAL ChangeDefaultSet(PTTSet ts, PKeyMap km) |
void WINAPI ChangeDefaultSet(PTTSet ts, PKeyMap km) |
| 166 |
{ |
{ |
| 167 |
if ((ts!=NULL) && |
if ((ts!=NULL) && |
| 168 |
(_stricmp(ts->SetupFName, pm->ts.SetupFName) == 0)) { |
(_stricmp(ts->SetupFName, pm->ts.SetupFName) == 0)) { |
| 173 |
} |
} |
| 174 |
} |
} |
| 175 |
|
|
| 176 |
void PASCAL GetDefaultSet(PTTSet ts) |
void WINAPI GetDefaultSet(PTTSet ts) |
| 177 |
{ |
{ |
| 178 |
memcpy(ts,&(pm->ts),sizeof(TTTSet)); |
memcpy(ts,&(pm->ts),sizeof(TTTSet)); |
| 179 |
} |
} |
| 180 |
|
|
| 181 |
|
|
| 182 |
/* Key scan code -> Tera Term key code */ |
/* Key scan code -> Tera Term key code */ |
| 183 |
WORD PASCAL GetKeyCode(PKeyMap KeyMap, WORD Scan) |
WORD WINAPI GetKeyCode(PKeyMap KeyMap, WORD Scan) |
| 184 |
{ |
{ |
| 185 |
WORD Key; |
WORD Key; |
| 186 |
|
|
| 194 |
return Key; |
return Key; |
| 195 |
} |
} |
| 196 |
|
|
| 197 |
void PASCAL GetKeyStr(HWND HWin, PKeyMap KeyMap, WORD KeyCode, |
void WINAPI GetKeyStr(HWND HWin, PKeyMap KeyMap, WORD KeyCode, |
| 198 |
BOOL AppliKeyMode, BOOL AppliCursorMode, |
BOOL AppliKeyMode, BOOL AppliCursorMode, |
| 199 |
BOOL Send8BitMode, PCHAR KeyStr, int destlen, |
BOOL Send8BitMode, PCHAR KeyStr, int destlen, |
| 200 |
LPINT Len, LPWORD Type) |
LPINT Len, LPWORD Type) |
| 848 |
PeekMessage(&Msg,HWin, WM_CHAR, WM_CHAR,PM_REMOVE); |
PeekMessage(&Msg,HWin, WM_CHAR, WM_CHAR,PM_REMOVE); |
| 849 |
} |
} |
| 850 |
|
|
| 851 |
void PASCAL SetCOMFlag(int Com) |
void WINAPI SetCOMFlag(int Com) |
| 852 |
{ |
{ |
| 853 |
pm->ComFlag[(Com-1)/CHAR_BIT] |= 1 << ((Com-1)%CHAR_BIT); |
pm->ComFlag[(Com-1)/CHAR_BIT] |= 1 << ((Com-1)%CHAR_BIT); |
| 854 |
} |
} |
| 855 |
|
|
| 856 |
void PASCAL ClearCOMFlag(int Com) |
void WINAPI ClearCOMFlag(int Com) |
| 857 |
{ |
{ |
| 858 |
pm->ComFlag[(Com-1)/CHAR_BIT] &= ~(1 << ((Com-1)%CHAR_BIT)); |
pm->ComFlag[(Com-1)/CHAR_BIT] &= ~(1 << ((Com-1)%CHAR_BIT)); |
| 859 |
} |
} |
| 860 |
|
|
| 861 |
int PASCAL CheckCOMFlag(int Com) |
int WINAPI CheckCOMFlag(int Com) |
| 862 |
{ |
{ |
| 863 |
return ((pm->ComFlag[(Com-1)/CHAR_BIT] & 1 << (Com-1)%CHAR_BIT) > 0); |
return ((pm->ComFlag[(Com-1)/CHAR_BIT] & 1 << (Com-1)%CHAR_BIT) > 0); |
| 864 |
} |
} |
| 865 |
|
|
| 866 |
int PASCAL RegWin(HWND HWinVT, HWND HWinTEK) |
int WINAPI RegWin(HWND HWinVT, HWND HWinTEK) |
| 867 |
{ |
{ |
| 868 |
int i, j; |
int i, j; |
| 869 |
|
|
| 894 |
} |
} |
| 895 |
} |
} |
| 896 |
|
|
| 897 |
void PASCAL UnregWin(HWND HWin) |
void WINAPI UnregWin(HWND HWin) |
| 898 |
{ |
{ |
| 899 |
int i, j; |
int i, j; |
| 900 |
|
|
| 932 |
return '+'; |
return '+'; |
| 933 |
} |
} |
| 934 |
|
|
| 935 |
void PASCAL SetWinMenu(HMENU menu, PCHAR buf, int buflen, PCHAR langFile, int VTFlag) |
void WINAPI SetWinMenu(HMENU menu, PCHAR buf, int buflen, PCHAR langFile, int VTFlag) |
| 936 |
{ |
{ |
| 937 |
int i; |
int i; |
| 938 |
char Temp[MAXPATHLEN]; |
char Temp[MAXPATHLEN]; |
| 1004 |
} |
} |
| 1005 |
} |
} |
| 1006 |
|
|
| 1007 |
void PASCAL SetWinList(HWND HWin, HWND HDlg, int IList) |
void WINAPI SetWinList(HWND HWin, HWND HDlg, int IList) |
| 1008 |
{ |
{ |
| 1009 |
int i; |
int i; |
| 1010 |
char Temp[MAXPATHLEN]; |
char Temp[MAXPATHLEN]; |
| 1030 |
} |
} |
| 1031 |
} |
} |
| 1032 |
|
|
| 1033 |
void PASCAL SelectWin(int WinId) |
void WINAPI SelectWin(int WinId) |
| 1034 |
{ |
{ |
| 1035 |
if ((WinId>=0) && (WinId<pm->NWin)) { |
if ((WinId>=0) && (WinId<pm->NWin)) { |
| 1036 |
/* ウィンドウが最大化および最小化されていた場合、その状態を維持できるように、 |
/* ウィンドウが最大化および最小化されていた場合、その状態を維持できるように、 |
| 1049 |
} |
} |
| 1050 |
} |
} |
| 1051 |
|
|
| 1052 |
void PASCAL SelectNextWin(HWND HWin, int Next, BOOL SkipIconic) |
void WINAPI SelectNextWin(HWND HWin, int Next, BOOL SkipIconic) |
| 1053 |
{ |
{ |
| 1054 |
int i; |
int i; |
| 1055 |
|
|
| 1078 |
SelectWin(i); |
SelectWin(i); |
| 1079 |
} |
} |
| 1080 |
|
|
| 1081 |
void PASCAL ShowAllWin(int stat) { |
void WINAPI ShowAllWin(int stat) { |
| 1082 |
int i; |
int i; |
| 1083 |
|
|
| 1084 |
for (i=0; i < pm->NWin; i++) { |
for (i=0; i < pm->NWin; i++) { |
| 1086 |
} |
} |
| 1087 |
} |
} |
| 1088 |
|
|
| 1089 |
void PASCAL UndoAllWin(void) { |
void WINAPI UndoAllWin(void) { |
| 1090 |
int i; |
int i; |
| 1091 |
WINDOWPLACEMENT rc0; |
WINDOWPLACEMENT rc0; |
| 1092 |
RECT rc; |
RECT rc; |
| 1153 |
} |
} |
| 1154 |
} |
} |
| 1155 |
|
|
| 1156 |
void PASCAL OpenHelp(UINT Command, DWORD Data, char *UILanguageFile) |
void WINAPI OpenHelp(UINT Command, DWORD Data, char *UILanguageFile) |
| 1157 |
{ |
{ |
| 1158 |
char HomeDir[MAX_PATH]; |
char HomeDir[MAX_PATH]; |
| 1159 |
char Temp[MAX_PATH]; |
char Temp[MAX_PATH]; |
| 1182 |
} |
} |
| 1183 |
} |
} |
| 1184 |
|
|
| 1185 |
HWND PASCAL GetNthWin(int n) |
HWND WINAPI GetNthWin(int n) |
| 1186 |
{ |
{ |
| 1187 |
if (n<pm->NWin) { |
if (n<pm->NWin) { |
| 1188 |
return pm->WinList[n]; |
return pm->WinList[n]; |
| 1192 |
} |
} |
| 1193 |
} |
} |
| 1194 |
|
|
| 1195 |
int PASCAL GetRegisteredWindowCount() |
int WINAPI GetRegisteredWindowCount() |
| 1196 |
{ |
{ |
| 1197 |
return (pm->NWin); |
return (pm->NWin); |
| 1198 |
} |
} |
| 1236 |
} |
} |
| 1237 |
|
|
| 1238 |
// ウィンドウを左右に並べて表示する(Show Windows Side by Side) |
// ウィンドウを左右に並べて表示する(Show Windows Side by Side) |
| 1239 |
void PASCAL ShowAllWinSidebySide(HWND myhwnd) |
void WINAPI ShowAllWinSidebySide(HWND myhwnd) |
| 1240 |
{ |
{ |
| 1241 |
int n; |
int n; |
| 1242 |
HWND hwnd[MAXNWIN]; |
HWND hwnd[MAXNWIN]; |
| 1246 |
} |
} |
| 1247 |
|
|
| 1248 |
// ウィンドウを上下に並べて表示する(Show Windows Stacked) |
// ウィンドウを上下に並べて表示する(Show Windows Stacked) |
| 1249 |
void PASCAL ShowAllWinStacked(HWND myhwnd) |
void WINAPI ShowAllWinStacked(HWND myhwnd) |
| 1250 |
{ |
{ |
| 1251 |
int n; |
int n; |
| 1252 |
HWND hwnd[MAXNWIN]; |
HWND hwnd[MAXNWIN]; |
| 1256 |
} |
} |
| 1257 |
|
|
| 1258 |
// ウィンドウを重ねて表示する(Cascade) |
// ウィンドウを重ねて表示する(Cascade) |
| 1259 |
void PASCAL ShowAllWinCascade(HWND myhwnd) |
void WINAPI ShowAllWinCascade(HWND myhwnd) |
| 1260 |
{ |
{ |
| 1261 |
int n; |
int n; |
| 1262 |
HWND hwnd[MAXNWIN]; |
HWND hwnd[MAXNWIN]; |
| 1266 |
} |
} |
| 1267 |
|
|
| 1268 |
// 全Tera Termに終了指示を出す。 |
// 全Tera Termに終了指示を出す。 |
| 1269 |
void PASCAL BroadcastClosingMessage(HWND myhwnd) |
void WINAPI BroadcastClosingMessage(HWND myhwnd) |
| 1270 |
{ |
{ |
| 1271 |
int i, max; |
int i, max; |
| 1272 |
HWND hwnd[MAXNWIN]; |
HWND hwnd[MAXNWIN]; |
| 1289 |
} |
} |
| 1290 |
|
|
| 1291 |
|
|
| 1292 |
int PASCAL CommReadRawByte(PComVar cv, LPBYTE b) |
int WINAPI CommReadRawByte(PComVar cv, LPBYTE b) |
| 1293 |
{ |
{ |
| 1294 |
if ( ! cv->Ready ) { |
if ( ! cv->Ready ) { |
| 1295 |
return 0; |
return 0; |
| 1310 |
} |
} |
| 1311 |
} |
} |
| 1312 |
|
|
| 1313 |
void PASCAL CommInsert1Byte(PComVar cv, BYTE b) |
void WINAPI CommInsert1Byte(PComVar cv, BYTE b) |
| 1314 |
{ |
{ |
| 1315 |
if ( ! cv->Ready ) { |
if ( ! cv->Ready ) { |
| 1316 |
return; |
return; |
| 1353 |
} |
} |
| 1354 |
} |
} |
| 1355 |
|
|
| 1356 |
int PASCAL CommRead1Byte(PComVar cv, LPBYTE b) |
int WINAPI CommRead1Byte(PComVar cv, LPBYTE b) |
| 1357 |
{ |
{ |
| 1358 |
int c; |
int c; |
| 1359 |
|
|
| 1423 |
return c; |
return c; |
| 1424 |
} |
} |
| 1425 |
|
|
| 1426 |
int PASCAL CommRawOut(PComVar cv, PCHAR B, int C) |
int WINAPI CommRawOut(PComVar cv, PCHAR B, int C) |
| 1427 |
{ |
{ |
| 1428 |
int a; |
int a; |
| 1429 |
|
|
| 1446 |
return a; |
return a; |
| 1447 |
} |
} |
| 1448 |
|
|
| 1449 |
int PASCAL CommBinaryOut(PComVar cv, PCHAR B, int C) |
int WINAPI CommBinaryOut(PComVar cv, PCHAR B, int C) |
| 1450 |
{ |
{ |
| 1451 |
int a, i, Len; |
int a, i, Len; |
| 1452 |
char d[3]; |
char d[3]; |
| 1483 |
return i; |
return i; |
| 1484 |
} |
} |
| 1485 |
|
|
| 1486 |
int PASCAL CommBinaryBuffOut(PComVar cv, PCHAR B, int C) |
int WINAPI CommBinaryBuffOut(PComVar cv, PCHAR B, int C) |
| 1487 |
{ |
{ |
| 1488 |
int a, i, Len, OutLen; |
int a, i, Len, OutLen; |
| 1489 |
char d[3]; |
char d[3]; |
| 1785 |
return i; |
return i; |
| 1786 |
} |
} |
| 1787 |
|
|
| 1788 |
int PASCAL CommTextOut(PComVar cv, PCHAR B, int C) |
int WINAPI CommTextOut(PComVar cv, PCHAR B, int C) |
| 1789 |
{ |
{ |
| 1790 |
int i, TempLen, OutLen; |
int i, TempLen, OutLen; |
| 1791 |
char TempStr[12]; |
char TempStr[12]; |
| 1888 |
return i; |
return i; |
| 1889 |
} |
} |
| 1890 |
|
|
| 1891 |
int PASCAL CommBinaryEcho(PComVar cv, PCHAR B, int C) |
int WINAPI CommBinaryEcho(PComVar cv, PCHAR B, int C) |
| 1892 |
{ |
{ |
| 1893 |
int a, i, Len; |
int a, i, Len; |
| 1894 |
char d[3]; |
char d[3]; |
| 1932 |
return i; |
return i; |
| 1933 |
} |
} |
| 1934 |
|
|
| 1935 |
int PASCAL TextEchoMBCS(PComVar cv, PCHAR B, int C) |
int WINAPI TextEchoMBCS(PComVar cv, PCHAR B, int C) |
| 1936 |
{ |
{ |
| 1937 |
int i, TempLen; |
int i, TempLen; |
| 1938 |
WORD K; |
WORD K; |
| 2107 |
return i; |
return i; |
| 2108 |
} |
} |
| 2109 |
|
|
| 2110 |
int PASCAL CommTextEcho(PComVar cv, PCHAR B, int C) |
int WINAPI CommTextEcho(PComVar cv, PCHAR B, int C) |
| 2111 |
{ |
{ |
| 2112 |
int i, TempLen; |
int i, TempLen; |
| 2113 |
char TempStr[11]; |
char TempStr[11]; |
| 2289 |
} |
} |
| 2290 |
|
|
| 2291 |
|
|
| 2292 |
int PASCAL DetectComPorts(LPWORD ComPortTable, int ComPortMax, char **ComPortDesc) |
int WINAPI DetectComPorts(LPWORD ComPortTable, int ComPortMax, char **ComPortDesc) |
| 2293 |
{ |
{ |
| 2294 |
HMODULE h; |
HMODULE h; |
| 2295 |
TCHAR devicesBuff[65535]; |
TCHAR devicesBuff[65535]; |
| 2346 |
return comports; |
return comports; |
| 2347 |
} |
} |
| 2348 |
|
|
| 2349 |
int PASCAL CheckComPort(WORD ComPort) |
int WINAPI CheckComPort(WORD ComPort) |
| 2350 |
{ |
{ |
| 2351 |
HMODULE h; |
HMODULE h; |
| 2352 |
TCHAR devicesBuff[65535]; |
TCHAR devicesBuff[65535]; |
| 2420 |
static int NotifyIconShowCount = 0; |
static int NotifyIconShowCount = 0; |
| 2421 |
static HICON CustomIcon = NULL; |
static HICON CustomIcon = NULL; |
| 2422 |
|
|
| 2423 |
void PASCAL SetCustomNotifyIcon(HICON icon) |
void WINAPI SetCustomNotifyIcon(HICON icon) |
| 2424 |
{ |
{ |
| 2425 |
CustomIcon = icon; |
CustomIcon = icon; |
| 2426 |
} |
} |
| 2427 |
|
|
| 2428 |
HICON PASCAL GetCustomNotifyIcon() |
HICON WINAPI GetCustomNotifyIcon() |
| 2429 |
{ |
{ |
| 2430 |
return CustomIcon; |
return CustomIcon; |
| 2431 |
} |
} |
| 2432 |
|
|
| 2433 |
void PASCAL CreateNotifyIcon(PComVar cv) |
void WINAPI CreateNotifyIcon(PComVar cv) |
| 2434 |
{ |
{ |
| 2435 |
if (cv->NotifyIcon == NULL) { |
if (cv->NotifyIcon == NULL) { |
| 2436 |
notify_icon.cbSize = sizeof(notify_icon); |
notify_icon.cbSize = sizeof(notify_icon); |
| 2462 |
return; |
return; |
| 2463 |
} |
} |
| 2464 |
|
|
| 2465 |
void PASCAL DeleteNotifyIcon(PComVar cv) |
void WINAPI DeleteNotifyIcon(PComVar cv) |
| 2466 |
{ |
{ |
| 2467 |
if (cv->NotifyIcon) { |
if (cv->NotifyIcon) { |
| 2468 |
Shell_NotifyIcon(NIM_DELETE, cv->NotifyIcon); |
Shell_NotifyIcon(NIM_DELETE, cv->NotifyIcon); |
| 2473 |
return; |
return; |
| 2474 |
} |
} |
| 2475 |
|
|
| 2476 |
void PASCAL ShowNotifyIcon(PComVar cv) |
void WINAPI ShowNotifyIcon(PComVar cv) |
| 2477 |
{ |
{ |
| 2478 |
if (cv->NotifyIcon == NULL) { |
if (cv->NotifyIcon == NULL) { |
| 2479 |
CreateNotifyIcon(cv); |
CreateNotifyIcon(cv); |
| 2488 |
return; |
return; |
| 2489 |
} |
} |
| 2490 |
|
|
| 2491 |
void PASCAL HideNotifyIcon(PComVar cv) |
void WINAPI HideNotifyIcon(PComVar cv) |
| 2492 |
{ |
{ |
| 2493 |
if (NotifyIconShowCount > 1) { |
if (NotifyIconShowCount > 1) { |
| 2494 |
NotifyIconShowCount -= 1; |
NotifyIconShowCount -= 1; |
| 2506 |
return; |
return; |
| 2507 |
} |
} |
| 2508 |
|
|
| 2509 |
void PASCAL SetVerNotifyIcon(PComVar cv, unsigned int ver) |
void WINAPI SetVerNotifyIcon(PComVar cv, unsigned int ver) |
| 2510 |
{ |
{ |
| 2511 |
if (cv->NotifyIcon) { |
if (cv->NotifyIcon) { |
| 2512 |
cv->NotifyIcon->uVersion = ver; |
cv->NotifyIcon->uVersion = ver; |
| 2515 |
return; |
return; |
| 2516 |
} |
} |
| 2517 |
|
|
| 2518 |
void PASCAL NotifyMessage(PComVar cv, char *msg, char *title, DWORD flag) |
void WINAPI NotifyMessage(PComVar cv, char *msg, char *title, DWORD flag) |
| 2519 |
{ |
{ |
| 2520 |
if (msg == NULL) { |
if (msg == NULL) { |
| 2521 |
return; |
return; |