So I know there are a lot of threads regarding this topic, but i can't seem to understand what people are talking about when they copy/paste a huge block of code and say "here try this". As an amateur programmer, that doesn't help me at all. So will someone please explain this in depth to me?
I am creating a third-party background application using Windows Speech Recognition for the game Smite by Hi-Rez Studios. For those of you that don't know about Smite, it has an in-game "quick ping" system. You press V to activate the system, and it comes up with a list of commands that you can use with further keys (for example "V, A, A is the command for "Attack" and V, A, F is the command for "attack fire giant"). Using the voice recognizer to detect when a command is spoken, it does a basic SendKeys command like this to emulate the keystrokes:
SendKeys.Send("vaa")
However, this code can also execute while other programs have focus, such as Notepad. I don't want this to happen. I want the SendKeys ONLY when Smite is the active window by running some sort of check to confirm that Smite is the active window before doing the SendKeys.
Can someone please explain to me how I would go about doing this? I would like to learn to do this rather than relying on the online community to provide me pieces of code that I copy and paste.