When using an ActiveX EXE that i wrote it takes focus all the time.
It displays a form which shows animations and graphics but has no input other than via vbscript.

It initialises but doesn't return focus to the controlling app without clicking on it.
Is there a way to stop it ever getting focus. Even when running, it constantly takes away focus from the main app forcing keyboard input etc and general performance to go down.
I have tried sending focus back to the main app all the time using SetWindowPos, SetForeGroundWindow etc. but none seem to work.
It appears that every time it updates a graphic or animation it wants focus. Even though I set the display form to be disabled, and use the
ShowWindow frmDisplay.hWnd, SW_SHOWNOACTIVATE
lResult = SetWindowPos(frmDisplay.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE)
Which should not only set the form as topmost but make it nonactive!!!
I've tried adjust thread priorities, and even putting a timer to constantly monitor the active window and switch windows if needed, but none seem to work, especially inside an activex exe.
Normal exes dont seem to have the problem.