Exemplo n.º 1
0
        private bool IsClassNameAllowed(WindowInfo window)
        {
            string className = window.ClassName;

            if (!string.IsNullOrEmpty(className))
            {
                return ignoreList.All(ignore => !className.Equals(ignore, StringComparison.InvariantCultureIgnoreCase));
            }

            return true;
        }
Exemplo n.º 2
0
 private bool IsValidWindow(WindowInfo window)
 {
     return window != null && window.IsVisible && !string.IsNullOrEmpty(window.Text) && IsClassNameAllowed(window) && window.Rectangle.IsValid();
 }
Exemplo n.º 3
0
 private bool IsValidWindow(WindowInfo window)
 {
     return(window != null && window.IsVisible && !string.IsNullOrEmpty(window.Text) && IsClassNameAllowed(window) && window.Rectangle.IsValid());
 }
Exemplo n.º 4
0
        private void SelectHandle()
        {
            WindowState = FormWindowState.Minimized;

            bool capturing = false;

            try
            {
                Thread.Sleep(250);

                SimpleWindowInfo simpleWindowInfo = GetWindowInfo();

                if (simpleWindowInfo != null)
                {
                    selectedWindow = new WindowInfo(simpleWindowInfo.Handle);
                    lblControlText.Text = selectedWindow.ClassName ?? string.Empty;
                    selectedRectangle = simpleWindowInfo.Rectangle;
                    lblSelectedRectangle.Text = selectedRectangle.ToString();
                    btnSelectRectangle.Enabled = btnCapture.Enabled = true;

                    if (Options.StartCaptureAutomatically)
                    {
                        capturing = true;
                        StartCapture();
                    }
                }
                else
                {
                    btnCapture.Enabled = false;
                }
            }
            finally
            {
                if (!capturing) this.ForceActivate();
            }
        }
Exemplo n.º 5
0
        private void btnSelectHandle_Click(object sender, EventArgs e)
        {
            Hide();
            SimpleWindowInfo simpleWindowInfo;

            try
            {
                Thread.Sleep(250);
                simpleWindowInfo = GetWindowInfo();
            }
            finally
            {
                Show();
            }

            if (simpleWindowInfo != null)
            {
                selectedWindow = new WindowInfo(simpleWindowInfo.Handle);
                lblControlText.Text = selectedWindow.ClassName ?? String.Empty;
                btnCapture.Enabled = true;
            }
            else
            {
                btnCapture.Enabled = false;
            }
        }