• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 402
  • Last Modified:

Detecting Full Screen OpenGL/DirectX

What's the most accurate way to detect if a full screen application (Either Open GL  or  Direct X) is open or not.


I need to be able to detect as soon as the computer goes into full screen mode for an open gl game or directx and then be able to detect as soon as the full screen application is no longer active.

Points will be awarded to the most effective complete solution.
0
selectgt
Asked:
selectgt
  • 2
  • 2
1 Solution
 
jimbobmcgeeCommented:
A full screen application in Windows is just a window with a width/height the same size as the screen.

I would enumerate the open windows with EnumWindows API, then get the window styles with GetWindowLong API and GetWindowRect API to determine if the width was the screen width, the height wa the screen height and the window had no border or caption.

HTH

J.
0
 
selectgtAuthor Commented:
OK then, now the 2nd part.  How do I determine if that application is Open GL  or  Direct X or neither of the 2?
0
 
jimbobmcgeeCommented:
I'm not too sure but I'd reckon on trying to pass a draw function for either to the window's DC.  In theory:

   -  Enumerate all open windows (EnumWindows API)
   -  Loop through each window (callback routine)
   -  Get the device context (DC) for the window (GetDC)
   -  Turn on error skipping (On Error Resume Next)
   -  Try to execute a D3D command to the DC (?)
   -  If there is an error, flag D3D as false
   -  Try to execute a OGL command to the DC (?)
   -  If there is an error, flag OGL as false
   -  Determine result from D3D and OGL flags.

That might be wishful thinking, though.

It might be better to determine why you need this function; other methods might be available...

HTH

J.
0
 
selectgtAuthor Commented:
The program does constant data processing utilizing, on my test machines, 10-15% of cpu power from 3Ghz processors.  When an open gl game or a direct x game is launched, i want it to go idle until it's finished.

Honestly, if anyone can help me solve this problem (with code examples or code solution) in whatever way, I'll still award all of the points and consider it a solution.
0
 
LunchyCommented:
Closed, 410 points refunded.
Lunchy
Friendly Neighbourhood Community Support Admin
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now