   Question related to DirectX
  Hi,   I have a few questions regarding DirectX and I haven''t been able to find an answer on the net or in any available document:1) Is there a way to easily determine if a program is using DirectX ?2) Is there a way to force a program who''s using DirectX to run in windowed mode ?3) (Non-DirectX related but game related) Other than using DirectX or GDI''s ChangeDisplaySetting, is there another way that profesionnal game programmer use to switch to full Screen ?Nick 
quote:Original post by StarGamer_Nick  2) Is there a way to force a program who''s using DirectX to run in windowed mode ?The only way I know is to use a stub d3d9.dll, and in the CreateDevice method change the presentation parameters before calling d3d''s CreateDevice. There''s a project on sourceforge that is named "evil hack" (I *think*) that demonstrates stub dlls for dx8.quote:3) (Non-DirectX related but game related) Other than using DirectX or GDI''s ChangeDisplaySetting, is there another way that profesionnal game programmer use to switch to full Screen ?Without using DirectX? I don''t get you here. If you want to work in full-screen, you need to either specify that in the presentation parameters, or Reset() with new presentation parameters.   Muhammad Haggag;quote:Original post by Coder  quote:3) (Non-DirectX related but game related) Other than using DirectX or GDI''s ChangeDisplaySetting, is there another way that profesionnal game programmer use to switch to full Screen ?Without using DirectX? I don''t get you here. If you want to work in full-screen, you need to either specify that in the presentation parameters, or Reset() with new presentation parameters.   I''m referring to game engine such the HL engine or the Quake engine or the Unreal engine, what function do they use to switch to fullscreen mode if they don''t use DirectX .;quote:Original post by StarGamer_Nick  1) Is there a way to easily determine if a program is using DirectX ?You could scan the executable for the d3d8/9 dll reference.  It wouldn''t be a guarantee, but it''d be a strong hint.quote:2) Is there a way to force a program who''s using DirectX to run in windowed mode ?In general, no.  There are various hacks available that can do things like this though.  Many games support windowed mode though it often isn''t documented.quote:3) (Non-DirectX related but game related) Other than using DirectX or GDI''s ChangeDisplaySetting, is there another way that profesionnal game programmer use to switch to full Screen ?If you''re using DX, obviously you use the DX method.  I know some OpenGL programs have used DX to change the screen mode (which isn''t recommended), but generally they just use ChangeDisplaySetting (which I believe has an Ex version as well). Stay Casual,KenDrunken Hyena;quote:1) Is there a way to easily determine if a program is using DirectX ?If you mean programmatically, I would think you could use EnumProcesModules (NT/2K/XP only) and then GetModuleFileNameEx, looking for d3d9.dll or whatever.quote:The only way I know is to use a stub d3d9.dll, and in the CreateDevice method change the presentation parameters before calling d3d's CreateDevice. There's a project on sourceforge that is named "evil hack" (I *think*) that demonstrates stub dlls for dx8.And Reset of course.If you just need to intercept one or two methods, it wouldn't be terribly difficult to setup a Win32 hook and then when your DLL gets called back, find and hook the appropriate method pointer(s) in the vtable(s).  (Not for the faint of heart either...)This is basically how FRAPS works.  Actually it modifies the instructions at the start of the Present method, which is doing things the hard way.EDIT: If you do this, evil as it is, you'd probably want to substitute in your own HWND as well.   [edited by - donavon keithley on February 8, 2004 5:00:07 AM]