/// <summary>
        /// Initializes a new instance of the <see cref="OverlayWindow"/> class.
        /// </summary>
        /// <param name="options">The options.</param>
        public OverlayWindow(OverlayCreationOptions options)
        {
            WindowTitle   = options.WindowTitle;
            BypassTopmost = options.BypassTopmost;

            _windowThread = new Thread(() => WindowThreadProcedure(options.X, options.Y, options.Width, options.Height))
            {
                IsBackground = true,
                Priority     = ThreadPriority.BelowNormal
            };
            _windowThread.Start();

            while (WindowHandle == IntPtr.Zero)
            {
                Thread.Sleep(10);
            }
        }
Example #2
0
        /// <summary>
        /// Installs the specified options.
        /// </summary>
        /// <param name="options">The options.</param>
        public void Install(OverlayCreationOptions options)
        {
            if (ParentWindowHandle == IntPtr.Zero || _exitServiceThread || _serviceThread != null)
            {
                return;
            }

            base.ShowWindow();

            _exitServiceThread = false;

            _serviceThread = new Thread(WindowService)
            {
                IsBackground = true,
                Priority     = ThreadPriority.BelowNormal
            };

            _serviceThread.Start();
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StickyOverlayWindow"/> class.
        /// </summary>
        /// <param name="parentWindowHandle">The parent window handle.</param>
        /// <param name="options">The options.</param>
        public StickyOverlayWindow(IntPtr parentWindowHandle, OverlayCreationOptions options) : base(options)
        {
            ParentWindowHandle = parentWindowHandle;

            Install(options);
        }