Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/ttpcmn/ttcmn.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7304 by zmatsuo, Sun Dec 2 15:51:37 2018 UTC revision 7305 by zmatsuo, Sun Dec 2 15:51:49 2018 UTC
# Line 73  enum window_style { Line 73  enum window_style {
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    
# Line 129  BOOL PASCAL StartTeraTerm(PTTSet ts) Line 129  BOOL PASCAL StartTeraTerm(PTTSet ts)
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;
# Line 162  void PASCAL RestartTeraTerm(HWND hwnd, P Line 162  void PASCAL RestartTeraTerm(HWND hwnd, P
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)) {
# Line 173  void PASCAL ChangeDefaultSet(PTTSet ts, Line 173  void PASCAL ChangeDefaultSet(PTTSet ts,
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    
# Line 194  WORD PASCAL GetKeyCode(PKeyMap KeyMap, W Line 194  WORD PASCAL GetKeyCode(PKeyMap KeyMap, W
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)
# Line 848  void PASCAL GetKeyStr(HWND HWin, PKeyMap Line 848  void PASCAL GetKeyStr(HWND HWin, PKeyMap
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    
# Line 894  int PASCAL RegWin(HWND HWinVT, HWND HWin Line 894  int PASCAL RegWin(HWND HWinVT, HWND HWin
894          }          }
895  }  }
896    
897  void PASCAL UnregWin(HWND HWin)  void WINAPI UnregWin(HWND HWin)
898  {  {
899          int i, j;          int i, j;
900    
# Line 932  char GetWindowTypeChar(HWND Hw, HWND HWi Line 932  char GetWindowTypeChar(HWND Hw, HWND HWi
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];
# Line 1004  void PASCAL SetWinMenu(HMENU menu, PCHAR Line 1004  void PASCAL SetWinMenu(HMENU menu, PCHAR
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];
# Line 1030  void PASCAL SetWinList(HWND HWin, HWND H Line 1030  void PASCAL SetWinList(HWND HWin, HWND H
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                  /* ウィンドウが最大化および最小化されていた場合、その状態を維持できるように、                  /* ウィンドウが最大化および最小化されていた場合、その状態を維持できるように、
# Line 1049  void PASCAL SelectWin(int WinId) Line 1049  void PASCAL SelectWin(int WinId)
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    
# Line 1078  void PASCAL SelectNextWin(HWND HWin, int Line 1078  void PASCAL SelectNextWin(HWND HWin, int
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++) {
# Line 1086  void PASCAL ShowAllWin(int stat) { Line 1086  void PASCAL ShowAllWin(int stat) {
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;
# Line 1153  void PASCAL UndoAllWin(void) { Line 1153  void PASCAL UndoAllWin(void) {
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];
# Line 1182  void PASCAL OpenHelp(UINT Command, DWORD Line 1182  void PASCAL OpenHelp(UINT Command, DWORD
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];
# Line 1192  HWND PASCAL GetNthWin(int n) Line 1192  HWND PASCAL GetNthWin(int n)
1192          }          }
1193  }  }
1194    
1195  int PASCAL GetRegisteredWindowCount()  int WINAPI GetRegisteredWindowCount()
1196  {  {
1197          return (pm->NWin);          return (pm->NWin);
1198  }  }
# Line 1236  static void get_valid_window_and_memoriz Line 1236  static void get_valid_window_and_memoriz
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];
# Line 1246  void PASCAL ShowAllWinSidebySide(HWND my Line 1246  void PASCAL ShowAllWinSidebySide(HWND my
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];
# Line 1256  void PASCAL ShowAllWinStacked(HWND myhwn Line 1256  void PASCAL ShowAllWinStacked(HWND myhwn
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];
# Line 1266  void PASCAL ShowAllWinCascade(HWND myhwn Line 1266  void PASCAL ShowAllWinCascade(HWND myhwn
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];
# Line 1289  void PASCAL BroadcastClosingMessage(HWND Line 1289  void PASCAL BroadcastClosingMessage(HWND
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;
# Line 1310  int PASCAL CommReadRawByte(PComVar cv, L Line 1310  int PASCAL CommReadRawByte(PComVar cv, L
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;
# Line 1353  void Log1Bin(PComVar cv, BYTE b) Line 1353  void Log1Bin(PComVar cv, BYTE b)
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    
# Line 1423  int PASCAL CommRead1Byte(PComVar cv, LPB Line 1423  int PASCAL CommRead1Byte(PComVar cv, LPB
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    
# Line 1446  int PASCAL CommRawOut(PComVar cv, PCHAR Line 1446  int PASCAL CommRawOut(PComVar cv, PCHAR
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];
# Line 1483  int PASCAL CommBinaryOut(PComVar cv, PCH Line 1483  int PASCAL CommBinaryOut(PComVar cv, PCH
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];
# Line 1785  int TextOutMBCS(PComVar cv, PCHAR B, int Line 1785  int TextOutMBCS(PComVar cv, PCHAR B, int
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];
# Line 1888  int PASCAL CommTextOut(PComVar cv, PCHAR Line 1888  int PASCAL CommTextOut(PComVar cv, PCHAR
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];
# Line 1932  int PASCAL CommBinaryEcho(PComVar cv, PC Line 1932  int PASCAL CommBinaryEcho(PComVar cv, PC
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;
# Line 2107  int PASCAL TextEchoMBCS(PComVar cv, PCHA Line 2107  int PASCAL TextEchoMBCS(PComVar cv, PCHA
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];
# Line 2289  cleanup: Line 2289  cleanup:
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];
# Line 2346  int PASCAL DetectComPorts(LPWORD ComPort Line 2346  int PASCAL DetectComPorts(LPWORD ComPort
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];
# Line 2420  static NOTIFYICONDATA notify_icon = {0}; Line 2420  static NOTIFYICONDATA notify_icon = {0};
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);
# Line 2462  void PASCAL CreateNotifyIcon(PComVar cv) Line 2462  void PASCAL CreateNotifyIcon(PComVar cv)
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);
# Line 2473  void PASCAL DeleteNotifyIcon(PComVar cv) Line 2473  void PASCAL DeleteNotifyIcon(PComVar cv)
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);
# Line 2488  void PASCAL ShowNotifyIcon(PComVar cv) Line 2488  void PASCAL ShowNotifyIcon(PComVar 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;
# Line 2506  void PASCAL HideNotifyIcon(PComVar cv) Line 2506  void PASCAL HideNotifyIcon(PComVar cv)
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;
# Line 2515  void PASCAL SetVerNotifyIcon(PComVar cv, Line 2515  void PASCAL SetVerNotifyIcon(PComVar cv,
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;

Legend:
Removed from v.7304  
changed lines
  Added in v.7305

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