rfvgyhn / min-ed-launcher

Minimal Elite Dangerous Launcher
MIT License
252 stars 9 forks source link

On restart: Elite Dangerous not as active window #47

Open AstralBlader opened 2 years ago

AstralBlader commented 2 years ago

This tool is great for farming various materials in VR, as you dont need to constantly take off your hmd to restart the game. Sadly this tool launches Elite Dangerous in a not active state, this means you need to click on the ED window each time you restart the game. Note that ED launches just fine on the first run. It only happens on restarts. Would it be possible to set the window as active after a restart, or directly start the game in a active window state?

rfvgyhn commented 2 years ago

Which OS and HMD are you using? I haven't run into the issue on linux with an index, but I also haven't played elite in a while. I should have some time this week to look into it.

AstralBlader commented 2 years ago

I am on Win10 latest and running elite in steamvr on HTC Vive. Recently I wasn't using VR to farm HGE's but the problem was still there...

Ok I figuered it out. I have a few autostart applications configuered, which are opened all in the foreground. Like I said, the first launch of ED is alright. But restarting doesnt focus back on the cmdlet and thus starts ED "behind" those apps. Only if I click on the cmdlet and back to ED (so its "behind" ED) after closing ED down the cmdlet start ED in foreground. Thats currently my workaround. But if I need to look something up on inara etc I need manually redo those steps everytime. a quick little [DllImport("User32.dll")] process = Process.Start(EliteDangerousPath + args); handle = process.MainWindowHandle; SetForegroundWindow(handle); might already do the trick.