Mes liens
Nuage de tags
Mur d'images
Quotidien
Flux RSS
  • Flux RSS
  • ATOM Feed
  • Daily Feed
Filtres

Liens par page

  • 20 links
  • 50 links
  • 100 links

Display

Filtrer par liens privés
2 résultats taggé sc2  ✕
An Automatic SC2 Game Start Switcher https://tl.net/forum/starcraft-2/400460-an-automatic-sc2-game-start-switcher
Sun Apr 3 00:04:18 2022
QRCode
using System;
using System.Runtime.InteropServices;
using System.Threading;
using Microsoft.Win32;

namespace SC2GameStartSwitcher
{
    class Program
    {
        //Import the FindWindow API to find our window
        [DllImport("User32.dll", EntryPoint = "FindWindow")]
        private static extern IntPtr FindWindowNative(string className, string windowName);

        //Import the SetForeground API to activate it
        [DllImport("User32.dll", EntryPoint = "SetForegroundWindow")]
        private static extern IntPtr SetForegroundWindowNative(IntPtr hWnd);

        public static IntPtr FindWindow(string className, string windowName)
        {
            return FindWindowNative(className, windowName);
        }

        public static IntPtr SetForegroundWindow(IntPtr hWnd)
        {
            return SetForegroundWindowNative(hWnd);
        }

        public static void Activate(string title)
        {
            //Find the window, using the Window Title
            IntPtr hWnd = FindWindow(null, title);
            if (hWnd.ToInt32() > 0) //If found
            {
                SetForegroundWindow(hWnd); //Activate it
            }
        }

        static void Main()
        {
            int gameState = 0;
            RegistryKey MyReg = Registry.CurrentUser.OpenSubKey
             ("Software\\Razer\\Starcraft2", true);
            MyReg.SetValue("APMValue", "1000");

            Console.WriteLine("\nWelcome to the StarCraft II Automatic Game Start Switcher.\n");
            Console.WriteLine("Game scanning initiated. Feel free to minimize this window.");

            while (true)
            {
                if (gameState == 0) { // in menus
                    Thread.Sleep(2000); // pause for 2 seconds
                    if ((int)MyReg.GetValue("StartModule") == 1) {
                        gameState = 1;
                    }
                } else if (gameState == 1) { // a game is loading
                    Thread.Sleep(10); // pause for 10 milliseconds
                    if (!MyReg.GetValue("APMValue").Equals("1000")) {
                        Activate("StarCraft II");
                        gameState = 2;
                    }
                } else if (gameState == 2) { // in a game
                    Thread.Sleep(2000); // pause for 2 seconds
                    if ((int)MyReg.GetValue("StartModule") == 0) {
                        gameState = 0;
                        MyReg.SetValue("APMValue", "1000");
                    }
                }
            }
        }

    }
}
sc2
CripSeil's Cheese (PvT) - Forums - StarCraft II http://eu.battle.net/sc2/fr/forum/topic/13686040652
Thu Mar 5 23:07:06 2015
QRCode
sc2
639 links
Shaarli - Le gestionnaire de marque-pages personnel, minimaliste, et sans base de données par la communauté Shaarli - Theme by kalvn