[Ttssh2-commit] [7222] 0817

Back to archive index

scmno****@osdn***** scmno****@osdn*****
2018年 9月 3日 (月) 19:51:53 JST


Revision: 7222
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7222
Author:   zmatsuo
Date:     2018-09-03 19:51:53 +0900 (Mon, 03 Sep 2018)
Log Message:
-----------
0817

# Conflicts:
#	teraterm/teraterm/teraterm_nomfc.cpp

Modified Paths:
--------------
    branches/cmake/teraterm/teraterm/teraterm.cpp

-------------- next part --------------
Modified: branches/cmake/teraterm/teraterm/teraterm.cpp
===================================================================
--- branches/cmake/teraterm/teraterm/teraterm.cpp	2018-09-03 10:51:50 UTC (rev 7221)
+++ branches/cmake/teraterm/teraterm/teraterm.cpp	2018-09-03 10:51:53 UTC (rev 7222)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1994-1998 T. Teranishi
- * (C) 2006-2017 TeraTerm Project
+ * (C) 2006-2018 TeraTerm Project
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,6 @@
 
 /* TERATERM.EXE, main */
 
-//#include "stdafx.h"
 #include "teraterm.h"
 #include "tttypes.h"
 #include "commlib.h"
@@ -46,7 +45,6 @@
 #include "ttdde.h"
 #include "keyboard.h"
 #include "compat_win.h"
-
 #include "compat_w95.h"
 
 static void init()
@@ -212,18 +210,20 @@
                    LPSTR lpszCmdLine, int nCmdShow)
 {
 	LONG lCount = 0;
-
+	DWORD SleepTick = 1;
 	init();
 	hInst = hInstance;
 	CVTWindow *m_pMainWnd = new CVTWindow();
-	pVTWin = m_pMainWnd->m_hWnd;
+	pVTWin = m_pMainWnd;
 	ShowWindow(m_pMainWnd->m_hWnd, nCmdShow);
 
 	MSG msg;
 	while (GetMessage(&msg, NULL, 0, 0)) {
+
 		if (MetaKey(ts.MetaKey)) {
 			continue;
 		}
+
 		if (m_pMainWnd->m_hAccel != NULL &&
 			!TranslateAccelerator(m_pMainWnd->m_hWnd , m_pMainWnd->m_hAccel, &msg))
 		{
@@ -231,22 +231,21 @@
 			DispatchMessage(&msg);
 		}
 
-		if (!OnIdle(lCount++)) {
-			lCount = 0;
+		while (!PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE)) {
+			// \x83\x81\x83b\x83Z\x81[\x83W\x82\xAA\x82Ȃ\xA2
+			if (!OnIdle(lCount)) {
+				// idle\x95s\x97v
+				if (SleepTick < 500) {	// \x8Dő\xE5 501ms\x96\xA2\x96\x9E
+					SleepTick += 2;
+				}
+				lCount = 0;
+				Sleep(SleepTick);
+			} else {
+				// \x97vidle
+				SleepTick = 0;
+				lCount++;
+			}
 		}
-    }
+	}
     return (msg.wParam);
 }
-
-#if 0
-
-#define COMPILE_NEWAPIS_STUBS 
-//#define WANT_GETDISKFREESPACEEX_WRAPPER // wrap for GetDiskFreeSpaceEx
-//#define WANT_GETLONGPATHNAME_WRAPPER // wrap for GetLongPathName
-//#define WANT_GETFILEATTRIBUTESEX_WRAPPER // wrap for GetFileAttributesEx
-#define WANT_ISDEBUGGERPRESENT_WRAPPER // wrap for wrap for IsDebuggerPresent
-#include <NewAPIs.h>
-
-// https://bearwindows.zcm.com.au/msvc.htm
-
-#endif



Ttssh2-commit メーリングリストの案内
Back to archive index