PDA

View Full Version : Problem with Windows Vista and Seven



mmaslana
11-16-2009, 11:21 AM
Hi,
I am the owner of Azereus, which functions and a description can be found at www.azereus.pl. (http://www.azereus.pl) This is a program used to fight with cheaters in multiplayer computer games. This program makes screenshots of what a Windows user sees on the screen. Making such discharge is to create a TCanvas class, set the handle to the active window by GetDesktopWindow function and then calling the method TCanvas.Canvas.CopyRect. The process is working properly, both the XP and Vista. Also works on XP when it is running the game (if the program makes the screenshots of the game), but unfortunately in the case of Vista, no longer the case. When the operating system is running a game, my program makes black screenshots. I do not know what is the cause, whether it is a problem with support for OpenGL, if the program uses the wrong window handle, or something else. In addition, the program described in the above situation does sound screenshots where the game is in window mode (not fullscreen) or using d3d mode. Please help, I join you take screenshots of the code:


function Tscreener.GetNowScreen: tjpegimage;
var
btMap:Tbitmap; //mapa bitowa
DeskTop: TCanvas;
begin
DeskTop := TCanvas.Create;
try
btMap := TBitmap.Create;
try
DeskTop.Handle := GetWindowDC ( GetForegroundWindow );
btMap.Width := Screen.Width;
btMap.Height := Screen.Height;
btMap.Canvas.CopyRect (Rect(0, 0, Screen.Width, Screen.Height), DeskTop,
Rect (0, 0, Screen.Width, Screen.Height));
Result := TJPEGImage.Create;
Result.CompressionQuality := 60;
Result.Assign(btMap);
finally
FreeAndNil(btMap);
end;
finally
FreeAndNil(DeskTop);
end;
end;

Greets,
v1o

sqrt[-1]
11-16-2009, 09:52 PM
You may want to read:

http://www.opengl.org/pipeline/article/vol003_9/

"Current Windows XP full screen OpenGL applications are likely to work, although applications that use GDI under the covers (e.g. taking screenshots using Alt+Print Screen, or some enhanced GDI mouse pointers) may not work."
http://www.opengl.org/pipeline/article/vol003_7/

I don't know how your program works, but you may have to insert a glReadPixels or something in order to always take screen shots. (or use a non-GDI method to take screen shots)