コード例 #1
0
        internal static void ShiftClick(GameProcessor gameProcessor)
        {
            IntPtr gameHandl = WinAPI.FindWindow(null, gameProcessor.Game.NameProcess);

            if (gameHandl == IntPtr.Zero)
            {
                return;
            }

            WinAPI.SendMessage(gameHandl, 0x100, (int)Key.RightShift, 1);
            App.Logger.Error("Key Shift is preesed");

            if (CurrentGame.TypeStartFocus == TypeStartFocus.FocusToMainWnd)
            {
                SwitchToMainWindow();
            }
        }
コード例 #2
0
        public static void Simulation(GameProcessor gameProcessor)
        {
            try
            {
                IntPtr gameHandl = WinAPI.FindWindow(null, gameProcessor.Game.NameProcess);

                if (gameHandl == IntPtr.Zero)
                {
                    return;
                }


                WinAPI.SetForegroundWindow(gameHandl);
                try
                {
                    SendKeys.SendWait(_stringButtonStart);
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e.Message);
                }


                if (_stringButtonAdditional != null || _stringButtonAdditional != string.Empty)
                {
                    Thread.Sleep(1000);
                    SendKeys.SendWait(_stringButtonAdditional);
                }

                if (CurrentGame.TypeStartFocus == TypeStartFocus.FocusToMainWnd)
                {
                    SwitchToMainWindow();
                }
                else if (gameProcessor.Game.TypeStartFocus == TypeStartFocus.FocusedInFullScreen)
                {
                    WinAPI.ShowWindow(gameHandl, 3);
                }
            }
            catch (Exception ex)
            {
                App.SendException(ex);
            }
        }