Help please with a temporary condition.
In the cycle, there is a check that the window is in focus, it is necessary as soon as the window focus is lost within 5 seconds to idle the cycle (to skip conditions), after 5 seconds the normal operation of the cycle again.
until did so:
IntPtr hWnd = FindWindow(null, "Название окна"); while (true) { //если hWnd нужного окна и текущего активного не совпадают, значит фокус пропал if (hWnd != GetForegroundWindow()) { MessageBox.Show("тут нужная функция"); } else continue; }
but this is not at all what is needed, I can’t figure out how to do it.