Exemple #1
0
        // Token: 0x06001613 RID: 5651 RVA: 0x0003519C File Offset: 0x0003339C
        public static bool smethod_0(Class141 process)
        {
            Process[] array = Class156.smethod_3("toontown");
            bool      result;

            try
            {
                if (array.Length != 1)
                {
                    result = false;
                }
                else
                {
                    int    id     = array[0].Id;
                    IntPtr intPtr = array[0].smethod_0();
                    if (!ToonTownParentForm.hashSet_0.Contains(id) && !(intPtr == IntPtr.Zero))
                    {
                        process.MainWindowHandle = intPtr;
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
            }
            finally
            {
                array.smethod_1 <Process>();
            }
            return(result);
        }
Exemple #2
0
        // Token: 0x060019D3 RID: 6611 RVA: 0x00047A08 File Offset: 0x00045C08
        public static bool smethod_3(string processName, Class141 process)
        {
            Process[] array = Class156.smethod_3(processName);
            bool      result;

            try
            {
                if (array.Length != 1)
                {
                    result = false;
                }
                else
                {
                    IntPtr intPtr = array[0].smethod_0();
                    Class335.smethod_3(Class197.string_2, new object[]
                    {
                        intPtr
                    });
                    process.MainWindowHandle = intPtr;
                    Class335.smethod_3(Class197.string_3, new object[]
                    {
                        process.MainWindowHandle
                    });
                    result = true;
                }
            }
            finally
            {
                array.smethod_1 <Process>();
            }
            return(result);
        }
Exemple #3
0
            // Token: 0x06001A3C RID: 6716 RVA: 0x0004D28C File Offset: 0x0004B48C
            public void method_0(object _)
            {
                IntPtr foregroundWindow = Class265.GetForegroundWindow();

                if (foregroundWindow == IntPtr.Zero)
                {
                    return;
                }
                Dictionary <IntPtr, Class205.Class127> dictionary = null;
                Struct21 hotkey = this.eventArgs18_0.State.Hotkey;

                lock (this.class205_0.dictionary_0)
                {
                    if (this.class205_0.dictionary_0.ContainsKey(hotkey))
                    {
                        dictionary = this.class205_0.dictionary_0[hotkey];
                        if (dictionary.ContainsKey(foregroundWindow))
                        {
                            this.class205_0.method_2(dictionary[foregroundWindow], true);
                            return;
                        }
                    }
                    Process process = null;
                    bool    flag2   = false;
                    try
                    {
                        process = Class265.smethod_7(foregroundWindow);
                        if (flag2 = (process.smethod_2().ToLower() == "toontown"))
                        {
                            Class87 @class = this.class205_0.class112_0.Hotkeys[hotkey];
                            Class205.Class206.Class207 class2 = new Class205.Class206.Class207();
                            class2.class206_0 = this;
                            switch (@class.HotkeyType)
                            {
                            case Enum40.const_0:
                                if (@class.StopOtherHotkeys)
                                {
                                    List <Class205.Class127> list = new List <Class205.Class127>();
                                    foreach (KeyValuePair <Struct21, Dictionary <IntPtr, Class205.Class127> > keyValuePair in this.class205_0.dictionary_0)
                                    {
                                        if (Struct21.smethod_1(keyValuePair.Key, hotkey) && keyValuePair.Value.ContainsKey(foregroundWindow))
                                        {
                                            list.Add(keyValuePair.Value[foregroundWindow]);
                                        }
                                    }
                                    foreach (Class205.Class127 hotkey2 in list)
                                    {
                                        this.class205_0.method_2(hotkey2, true);
                                    }
                                }
                                if (dictionary == null)
                                {
                                    this.class205_0.dictionary_0.Add(hotkey, dictionary = new Dictionary <IntPtr, Class205.Class127>());
                                }
                                class2.class127_0 = new Class205.Class127(foregroundWindow, process, @class);
                                dictionary.Add(foregroundWindow, class2.class127_0);
                                process.EnableRaisingEvents = true;
                                process.Exited += class2.method_0;
                                class2.class127_0.Terminated += class2.method_1;
                                if (process.HasExited)
                                {
                                    this.class205_0.method_2(class2.class127_0, false);
                                }
                                else
                                {
                                    class2.class127_0.method_5();
                                }
                                break;

                            case Enum40.const_1:
                            {
                                Process[] array = null;
                                try
                                {
                                    array = Class156.smethod_3("toontown");
                                    if (array.Length > 1)
                                    {
                                        int i = 0;
                                        while (i < array.Length)
                                        {
                                            if (!(array[i].smethod_0() == foregroundWindow))
                                            {
                                                i++;
                                            }
                                            else
                                            {
                                                IntPtr intPtr;
                                                if (i == array.Length - 1)
                                                {
                                                    intPtr = array[0].smethod_0();
                                                }
                                                else
                                                {
                                                    intPtr = array[i + 1].smethod_0();
                                                }
                                                if (intPtr != IntPtr.Zero)
                                                {
                                                    Class410.smethod_8(this.class205_0, intPtr);
                                                    break;
                                                }
                                                break;
                                            }
                                        }
                                    }
                                }
                                finally
                                {
                                    if (array != null)
                                    {
                                        foreach (Process process2 in array)
                                        {
                                            process2.Dispose();
                                        }
                                    }
                                }
                                break;
                            }
                            }
                        }
                    }
                    finally
                    {
                        if (!flag2 && process != null)
                        {
                            process.Dispose();
                        }
                    }
                }
            }