예제 #1
0
        public FakeWindow(IntPtr handle, FakeWindow parent, string className = null, string name = null)
        {
            if (handle == IntPtr.Zero)
            {
                throw new ArgumentOutOfRangeException(nameof(handle) + " cannot be zero");
            }

            Handle    = handle;
            Parent    = parent;
            ClassName = !string.IsNullOrEmpty(className) ? className : GetWindowClassName(handle);
            Name      = !string.IsNullOrEmpty(name) ? name : GetWindowName(handle);
        }
예제 #2
0
파일: Helper.cs 프로젝트: ping11700/LOLSkin
        public static List <FakeWindow> GetWindows(string className, string windowTitle)
        {
            var hwnd    = IntPtr.Zero;
            var windows = new List <FakeWindow>();

            while ((hwnd = Win32API.FindWindowEx(IntPtr.Zero, hwnd, className, windowTitle)) != IntPtr.Zero)
            {
                FakeWindow window = new FakeWindow(hwnd, IntPtr.Zero, className, windowTitle);
                windows.Add(window);
            }

            return(windows);
        }
예제 #3
0
        public FakeWindow(IntPtr handle, IntPtr parentHandle, string className = null, string name = null)
        {
            if (handle == IntPtr.Zero)
            {
                throw new ArgumentOutOfRangeException(nameof(handle) + " cannot be zero");
            }

            if (parentHandle != IntPtr.Zero)
            {
                Parent = new FakeWindow(parentHandle, Win32API.GetParent(parentHandle));
            }
            else
            {
                Parent = null;
            }

            Handle    = handle;
            ClassName = !string.IsNullOrEmpty(className) ? className : GetWindowClassName(handle);
            Name      = !string.IsNullOrEmpty(name) ? name : GetWindowName(handle);
        }
예제 #4
0
 public FakeClientWindow(IntPtr handle, FakeWindow parent, string className, string windowName, FakeWindow innerWindow) : base(handle, parent, className, windowName)
 {
     InnerWindow = innerWindow;
 }