摘要: View Code public class MyProcess { private bool haveMainWindow = false; private IntPtr mainWindowHandle = IntPtr.Zero; private int processId = 0; private delegate bool EnumThreadWindowsCallback(IntPtr hWnd, IntPtr lParam); public IntPtr GetMainWindowHandle(int p... 阅读全文
posted @ 2012-03-21 23:35 ghypnus 阅读(992) 评论(0) 推荐(1) 编辑
摘要: bool bOnlyOneInstance = false;System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.UserAppDataPath.Replace(@"\", "_"), out bOnlyOneInstance);if (!bOnlyOneInstance) { MessageUtil.ShowTips("程序已经运行!"); System.Environment.Exit(0); return; } 阅读全文
posted @ 2012-03-21 23:11 ghypnus 阅读(429) 评论(0) 推荐(0) 编辑