Click to See Complete Forum and Search --> : Hardware Acceleration..........


ashwath_h
August 25th, 2005, 02:20 AM
hi all,

How to check whether the "hardware acceleration" is ON or OFF through program.Are there any shell Apis for this purpose.Kindly help me on this.

C.Schlue
August 25th, 2005, 05:02 AM
virtual HRESULT CWindows::_GetIsHardwareAcceleratinOnOrOffPlease( BOOL& bIsHWAccOn)

So, what do you want to do??

ashwath_h
August 25th, 2005, 07:34 AM
There is a project for which this has to be done.

C.Schlue
August 25th, 2005, 07:41 AM
Okok...

Descibe your problem in more detail.
What exactly do you want to do?
What HW Acceleration? 3D Graphics Acceleration?

ashwath_h
August 25th, 2005, 07:56 AM
yes 3D Graphics Acceleration.
Basically in the "Display Properties" dialog box...after clicking "Settings" Tab....
In that after clicking "Advanced" you click "troubleshooting" tab.In that there is Hardware acceleration slider bar.I want to know its status through program.Is there any registry entries where its status is set.

C.Schlue
August 25th, 2005, 08:00 AM
Hmmm, I dont know the api function to get or set that property.

I guess the easyest way would be to use the Registry Monitor from SysInternals to check which regkeys are changed when you set the property.


But maybe someone else knows the api?

ashwath_h
August 25th, 2005, 08:05 AM
How can i get this utility called "Registry Monitor" from SysInternals .
Can u kindly let me know about that.

C.Schlue
August 25th, 2005, 08:08 AM
http://www.sysinternals.com/Utilities/Regmon.html

You can find lots of useful (free) utilitys there.

Mike Harnad
August 25th, 2005, 09:33 AM
Try this:

Call GetPixelFormat() to get the current pixel format index. Then, call DescribePixelFormat() to get the pixel format descriptor. Check the pixel format descriptor flags for PFD_GENERIC_ACCELERATED.

ashwath_h
August 29th, 2005, 01:42 AM
Can u kindly send me the complete code for this please.

Thanking you,
ashwath

ashwath_h
August 29th, 2005, 04:38 AM
HI,
Is the below code correct?

PIXELFORMATDESCRIPTOR pfd;
HDC hdc;
int iPixelFormat;

HWND hWnd=::GetForegroundWindow();

hdc=::GetDC(hWnd);


// get the current pixel format index
iPixelFormat = GetPixelFormat(hdc);

// obtain a detailed description of that pixel format
DescribePixelFormat(hdc, iPixelFormat,
sizeof(PIXELFORMATDESCRIPTOR), &pfd);

if(pfd.dwFlags == PFD_GENERIC_ACCELERATED)
::MessageBox(NULL,"1","1",MB_OK);

Mike Harnad
August 29th, 2005, 08:48 AM
I think you want something like this:

if(pfd.dwFlags & PFD_GENERIC_ACCELERATED)
::MessageBox(NULL,"1","1",MB_OK);

ashwath_h
August 29th, 2005, 09:03 AM
I tried this code ,but it does not work.it gives the same result when the hardware accelerator is ON and OFF.Can u kindly suggest me some other method of knowing whether the HARDWARE ACCELERATOR is ON/OFF.

Mike Harnad
August 29th, 2005, 09:09 AM
Take a look at OpenGL.org (http://www.opengl.org/resources/faq/technical/mswindows.htm#0030) .

Marc G
August 29th, 2005, 02:56 PM
[ moved thread ]