0

I am looking into making a launcher for a few of my games using Windows Forms. Here is what I am wondering:

How would I make the app run in the background so it can detect input similar to discord's overlay. For example, even when discord isn't open, you can press Shift + ` to open an overlay.

I think it has something to do with this, it looks like discord is running as some sort of background application but I haven't found much guidance on how to go about creating one. Thanks!

PatAPizza
  • 7
  • 1
  • 2
  • [NotifyIcon](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.notifyicon) + [GameOverlay](https://github.com/michel-pi/GameOverlay.Net) – Jimi Dec 20 '20 at 23:21
  • For the "detect input" part, use either (1) `RegisterHotKey()`, or (2) `WH_KEYBOARD_LL`. You also might be interested in starting your app via an [ApplicationContext](https://stackoverflow.com/a/32909558/2330053). – Idle_Mind Dec 22 '20 at 20:08

1 Answers1

0

Try using this.Hide(); to hide the launcher. As far as I'm aware hiding still makes that certain form work in the background. Then use the Keydown event so that the program knows that it should Unhide the form by pressing Shift + '.

However, if you're creating a new instance of the launcher or close it in certain steps then using .Show(); will make an error. I recommend reading this answer below about unhiding the form Showing a hidden form.

NC101
  • 18
  • 2