OSDN Git Service

Moved translation support into MUtilities library + make clean-up of temporary files...
[mutilities/MUtilities.git] / src / OSSupport_Win32.cpp
index 33d3934..f47590d 100644 (file)
@@ -19,8 +19,6 @@
 // http://www.gnu.org/licenses/lgpl-2.1.txt
 //////////////////////////////////////////////////////////////////////////////////
 
-#pragma once
-
 //Win32 API
 #define WIN32_LEAN_AND_MEAN 1
 #include <Windows.h>
@@ -29,6 +27,7 @@
 #include <Sensapi.h>
 #include <Shellapi.h>
 #include <PowrProf.h>
+#include <Mmsystem.h>
 
 //Internal
 #include <MUtils/Global.h>
@@ -934,6 +933,29 @@ quint32 MUtils::OS::process_id(const QProcess *proc)
 }
 
 ///////////////////////////////////////////////////////////////////////////////
+// SYSTEM TIMER
+///////////////////////////////////////////////////////////////////////////////
+
+bool MUtils::OS::setup_timer_resolution(const quint32 &interval)
+{
+       return timeBeginPeriod(interval) == TIMERR_NOERROR;
+}
+
+bool MUtils::OS::reset_timer_resolution(const quint32 &interval)
+{
+       return timeEndPeriod(interval) == TIMERR_NOERROR;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// CHECK KEY STATE
+///////////////////////////////////////////////////////////////////////////////
+
+bool MUtils::OS::check_key_state_esc(void)
+{
+       return (GetAsyncKeyState(VK_ESCAPE) & 0x0001) != 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
 // DEBUGGER CHECK
 ///////////////////////////////////////////////////////////////////////////////