0

What would be the cleanest method for determining if the active foreground window is using direct3d.

I know I can check if it has d3d modules loaded, but that alone doesn't confirm without a shadow of a doubt that it is rendering with direct3d.

I could scan the memory to see if instances of the classes have been initialized, but that takes up too much CPU and time.

The solution has to be very fast and very low on resource usage so that it can be used once per second to determine if my own application needs to close to free up resources for people to play their games.

John
  • 5,942
  • 3
  • 42
  • 79

1 Answers1

-1

Hooking into games (injecting DLLs) can have very bad consequences for gamers… as in they can get banned. Anti-cheating programs check for such unknown DLLs.

What you need to do is detect when your window is minimized and free up resources or at least pause rendering. When it comes back up, continue business as usual.

Or just teach your users to close the app while playing, like everyone does. A smart gamer plays games with everything non-game required closed.

CodeAngry
  • 12,760
  • 3
  • 50
  • 57
  • I'm aware injecting dlls can trigger false positives with anti-cheats. My application runs all day. Minimizing it does not mean that the user isn't using it. I rather not inconvenience my users by having them manually close and restart the application whenever they jump in and out of games. – John Nov 06 '16 at 14:00
  • 1
    You haven't actually stated your problem above, just a proposed solution. Whether someone is playing a game or not on the system, your application should use to little to no resources when minimized. – Chuck Walbourn Nov 07 '16 at 17:07
  • The problem is implied. Its not an application that can be minimized. – John Nov 07 '16 at 22:43