Ejemplo n.º 1
0
        /// <summary>
        /// Constructor, takes the lobby window handle
        /// </summary>
        /// <param name="handle"></param>
        public PartyLobby(int handle)
        {
            // Set our handle
            this.handle = handle;

            // Create a WindowFinder
            WindowFinder wf = new WindowFinder();

            // Find the lobby treeview
            int tmpTreeviewHandle = wf.FindWindow(handle, "SysTreeView32", "Tree1", new Size(154, 403), true);

            int tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(422, 268), false);

            if (tmpListviewHandle == 0)
            {
                tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(422, 157), false);
            }
            if (tmpListviewHandle == 0)
            {
                tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(422, 416), false);
            }
            if (tmpListviewHandle == 0)
            {
                tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(422, 305), false);
            }
            if (tmpListviewHandle == 0)
            {
                tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(585, 305), false);
            }
            if (tmpListviewHandle == 0)
            {
                tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(585, 416), false);
            }

            // Did we find the treeview?
            if (tmpTreeviewHandle != 0)
            {
                lobbyTreeviewHandle = tmpTreeviewHandle;
            }
            else
            {
                totalAbort            = true;
                totalAbortDescription = "The lobby treeview could not be found, please make sure it's open";
            }

            // Did we find the listview?
            if (tmpListviewHandle != 0)
            {
                lobbyListviewHandle = tmpListviewHandle;
            }
            else
            {
                totalAbort            = true;
                totalAbortDescription = "The lobby listview could not be found, please make sure it's open";
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor, takes the lobby window handle
        /// </summary>
        /// <param name="handle"></param>
        public PartyLobby(int handle)
        {
            // Set our handle
            this.handle = handle;

            // Create a WindowFinder
            WindowFinder wf = new WindowFinder();

            // Find the lobby treeview
            int tmpTreeviewHandle = wf.FindWindow(handle, "SysTreeView32", "Tree1", new Size(154, 403), true);

            int tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(422, 268), false);
            if(tmpListviewHandle == 0)
                tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(422, 157), false);
            if (tmpListviewHandle == 0)
                tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(422, 416), false);
            if (tmpListviewHandle == 0)
                tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(422, 305), false);
            if (tmpListviewHandle == 0)
                tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(585, 305), false);
            if (tmpListviewHandle == 0)
                tmpListviewHandle = wf.FindWindow(handle, "SysListView32", "List1", new Size(585, 416), false);

            // Did we find the treeview?
            if(tmpTreeviewHandle != 0)
                lobbyTreeviewHandle = tmpTreeviewHandle;
            else
            {
                totalAbort = true;
                totalAbortDescription = "The lobby treeview could not be found, please make sure it's open";
            }

            // Did we find the listview?
            if(tmpListviewHandle != 0)
                lobbyListviewHandle = tmpListviewHandle;
            else
            {
                totalAbort = true;
                totalAbortDescription = "The lobby listview could not be found, please make sure it's open";
            }
        }