Ejemplo n.º 1
0
        /// <summary>
        /// 获取梦幻西游的全部句柄信息
        /// </summary>
        /// <returns></returns>
        public static Dictionary <IntPtr, string> GetMHWindows()
        {
            Dictionary <IntPtr, string> wins = new Dictionary <IntPtr, string>();
            IntPtr ws = LoadDll.FindWindow(Global.mh_class, null);

            if (ws.ToInt32() > 0)
            {
                wins[ws] = LoadDll.GetWindowsName(ws);
                while (ws.ToInt32() > 0)
                {
                    ws = LoadDll.FindWindowEx(IntPtr.Zero, ws, Global.mh_class, null);
                    if (ws.ToInt32() > 0)
                    {
                        wins[ws] = LoadDll.GetWindowsName(ws);
                    }
                }
            }
            return(wins);
        }