From 1a1c8e71fcd14858f595029f089b2d4a00202b32 Mon Sep 17 00:00:00 2001
From: ogi <Administrator@S-OGI-PC>
Date: Fri, 05 Dec 2025 09:24:16 +0900
Subject: [PATCH] プロジェクトファイルを追加。
---
HotelPms.Share/Util/SystemCommon.cs | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/HotelPms.Share/Util/SystemCommon.cs b/HotelPms.Share/Util/SystemCommon.cs
new file mode 100644
index 0000000..554983d
--- /dev/null
+++ b/HotelPms.Share/Util/SystemCommon.cs
@@ -0,0 +1,47 @@
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace HotelPms.Share.Util
+{
+ public class SystemCommon
+ {
+ [DllImport("user32.dll", SetLastError = true)]
+ private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
+
+ /// <summary> 待ち
+ /// </summary>
+ /// <param name="milliseconds"></param>
+ public static void Wait(double milliseconds)
+ {
+ DateTime t = DateTime.Now.AddMilliseconds(milliseconds);
+ while (DateTime.Now < t)
+ {
+ Thread.Sleep(1);
+ if (DateTime.Now.AddMilliseconds(milliseconds + 1000) < t) { break; } //途中でシステム時間変わった!!
+ }
+ }
+
+ //public static void WaitDisktop()
+ //{
+ // // wait until desktop ready
+ // IntPtr lHwnd = IntPtr.Zero;
+ // do
+ // {
+ // lHwnd = FindWindow("Shell_TrayWnd", null);
+ // Thread.Sleep(100);
+ // } while (lHwnd == IntPtr.Zero);
+ //}
+
+ public static void WaitDisktop()
+ {
+ while (true)
+ {
+ if (Process.GetProcessesByName("winlogon").Length > 0 && Process.GetProcessesByName("explorer").Length > 0)
+ {
+ break;
+ }
+ Thread.Sleep(1);
+ }
+ }
+ }
+}
--
Gitblit v1.10.0