electronin #1 You could use SetForegroundWindow, also from user32.dll: SetForegroundWindow%(hwnd%):"SetForegroundWindow"