Esempio n. 1
0
        public void GetClassName_NullWindow()
        {
            Action action = () => WindowMethods.GetClassName(WindowHandle.Null);

            // Invalid window handle. (1400)
            action.ShouldThrow <IOException>().And.HResult.Should().Be(unchecked ((int)0x80070578));
        }
Esempio n. 2
0
        public void GetClassName_Global()
        {
            WindowHandle window = new WindowHandle();

            try
            {
                window = WindowMethods.CreateWindow("button", "GetClassName_Global", WindowStyles.Diabled | WindowStyles.Minimize);
                window.IsValid.Should().BeTrue();
                WindowMethods.GetClassName(window).Should().Be("Button");
            }
            finally
            {
                if (window.IsValid)
                {
                    WindowMethods.DestroyWindow(window);
                }
            }
        }
Esempio n. 3
0
        public void GetClassLong_GlobalAtom()
        {
            WindowHandle window = new WindowHandle();

            try
            {
                window = WindowMethods.CreateWindow("bUttOn", "GetClassLong_GlobalAtom", WindowStyles.Diabled | WindowStyles.Minimize);
                window.IsValid.Should().BeTrue();
                Atom atom = WindowMethods.GetClassLong(window, ClassLong.Atom);
                atom.IsValid.Should().BeTrue();
                WindowMethods.DestroyWindow(window);
                window = WindowMethods.CreateWindow(atom, "GetClassLong_GlobalAtom", WindowStyles.Diabled | WindowStyles.Minimize);
                WindowMethods.GetClassName(window).Should().Be("Button");
            }
            finally
            {
                if (window.IsValid)
                {
                    WindowMethods.DestroyWindow(window);
                }
            }
        }
Esempio n. 4
0
 public void GetClassName()
 {
     WindowMethods.GetClassName(WindowMethods.GetShellWindow()).Should().Be("Progman");
 }
Esempio n. 5
0
 public static string GetClassName(this WindowHandle window) => WindowMethods.GetClassName(window);