Exemple #1
0
        public static bool TryGetActiveEveCharacter(out string characterName)
        {
            var title = Win32ActiveWindow.GetActiveWindowTitle();

            if (title.StartsWith("EVE - "))
            {
                characterName = title.Substring("EVE - ".Length);
                return(true);
            }

            characterName = null;
            return(false);
        }
Exemple #2
0
        private void OnWindowSwitch(IntPtr hwineventhook, uint eventtype, IntPtr hwnd, int idobject, int idchild,
                                    uint dweventthread, uint dwmseventtime)
        {
            var title = Win32ActiveWindow.GetActiveWindowTitle();

            if (title.StartsWith("EVE - "))
            {
                var charName = title.Substring("EVE - ".Length);
                if (charName == _lastActiveCharacter)
                {
                    return;
                }
                _lastActiveCharacter = charName;
                ActiveCharacterChanged(charName);
                //TODO das muss woanders passieren
                if (Settings.Default.IsSwitchingActiveProfileAutomatically)
                {
                    Settings.Default.ActivateProfileForCharacter(charName);
                }
            }
        }