Function for the program (stop) by pressing the keys

Marat
Employer

[no-member:pro]Marat[/no-member:pro]Marat

1 projects
Closed
Project parameters
Type of cooperationOne-time project
Prepaymentwithout prepayment
Payment methodsElectronic money
Acceptance of requestsclosed
Project description
There's an endless cycle. In this cycle, different windows (many windows) are minimized, then maximized.
This cycle is endless. You need to stop this cycle by pressing the Escape key. The problem is that the main form window is Form1.
It is not displayed at all while this cycle is going on, because The cycle displays other windows - all in a row.
They flash on the screen all the time. And it is not possible from Form1 to catch the Escape press using Form1.OnkeyDown.
So. This Form1 form is not active (it is not visible on the screen at all). How to make Escape key control from Form1?
Form1 is required even when it is not active in catching any keystrokes (including functional ones).

I made one option: I created a new Form_Wait_For_Key form that waits for Escape to be pressed for a while.
According to the timer, it transmits information to Form1 that the Escape key has been pressed.
But here's a new problem. When you display Form_Wait_For_Key by the Show method, this form is Form_Wait_For_Key.
It is visible on the screen (over all windows), but it is inactive and is inactive.
She doesn't catch the keystrokes. How do you make the form active? What are the methods and properties for this?
The Form.Active property can only be read, but I have to write it down. Make the shape active. How do you do that?

What needs to be done:
1. Ideally, I'd like to do a global key capture from an inactive form -- any keys.
I was told it was done with WH_KEYBOARD_LL, but I don't know how.

2. First of all, you need to make a quick version with Form_Wait_For_Key. We need a way to make the form active.

How much will all this cost?
It's urgent.
Project author: Marat