Piece of cake! Use SetForegroundWindow -> http://msdn.microsoft.com/en-us/library/ms633539(v=vs.85).aspx
#define _WIN32_WINNT 0x0500
#include <windows.h>
int main()
{
HWND hwnd = GetConsoleWindow();
int timer_1 = 0;
int timer_2 = 0;
int delay = 50;
while (true)
{
if (timer_1 > 100)
{
if (GetAsyncKeyState(VK_ESCAPE) >> 15) break;
timer_1 = 0;
}
if (timer_2 > 3000)
{
SetForegroundWindow(hwnd); Sleep(15);
SetForegroundWindow(hwnd);
timer_2 = 0;
}
timer_1 += delay;
timer_2 += delay;
Sleep(delay);
}
}