I just started experiencing this today.
When i join any type of game in Heroes & Generals that has real players as opposition the ingame window decides to close automatically. It's usually when i'm driving or flying which is extremely annoying.
Here is some raw footage of this strang phenomenon:
Sorry for the terrible quality, can't record my screen so i did it with my phone. But you can clearly see the problem and it occurs frequenlty too.
If you need me to include anything to find a solution, just ask me, cause i really want to know how to fix this annoying problem.