Answer the question
In order to leave comments, you need to log in
C++/cli win forms global click interception?
It is necessary to force the stream to turn on when a key is pressed. Windows Forms generally does not work well with an event such as pressing a physical button. And you need to make it so that it detects pressing even when there is no focus on the form, that is, it is collapsed. It is necessary that the loop inside the thread work while the key is pressed.
public: void Thread()
{
do {
//делаем чота
Sleep(300);
} while (checkBox1->Checked);
}
//тут мы зажимаем клавишу
{
Thread^ myThread2;
myThread2 = gcnew Thread(gcnew ThreadStart(this, &MyForm::Thread));
myThread2->Start();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question