OSDN Git Service

Version 4.00
[vbslib/main.git] / _src / Test / tools / SetSuspendState / src / SetSuspendState.c
diff --git a/_src/Test/tools/SetSuspendState/src/SetSuspendState.c b/_src/Test/tools/SetSuspendState/src/SetSuspendState.c
new file mode 100644 (file)
index 0000000..3e7dfd6
--- /dev/null
@@ -0,0 +1,16 @@
+#include  <windows.h> \r
+#include  <tchar.h>\r
+#include  <PowrProf.h>\r
+\r
+\r
+int APIENTRY _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,\r
+                        LPTSTR    lpCmdLine, int       nCmdShow )\r
+{\r
+  if ( lpCmdLine[0] == _T('\0') || lpCmdLine[0] == _T('0') )\r
+    SetSuspendState( 0, 1, 0 );  // Sleep\r
+  else\r
+    SetSuspendState( 1, 1, 0 );  // Hibernate\r
+  return 0;\r
+}\r
+\r
\r