Question

My laptop computer has (probably) corrupted graphics card memory and it causes some bizarre errors such as colorful dots appearing all over the screen, cursor jumping up and down and freezing occasionally. I noticed that the problems go away when I turn off HW acceleration in Windows. Whenever I want to play a movie, the picture is blocky unless I reactivate HW acceleration.

Doing this manually is annoying and it takes some time so I would like to make a little program to automate the process of disabling or enabling HW acceleration on all displays (equivalent to moving the slider all the way to the left in screen settings). I have no previous experience with programming for Windows so I will appreciate if someone can at least point me in the right direction.

I am a cheapskate, buying a new computer is not an option since this one works quite well while I keep HW acceleration disabled.

Edit: The acceleration level is in my case stored in the registry key

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Video{85D18855-5163-4CFC-8A71-222DCC03C001}\0000

"Acceleration.Level"=dword:00000005

The key is not there by default, deleting it and changing color depth switches HW acceleration back on.

Was it helpful?

Solution

A side note: Serious problems might be developing...

These errors are a sign that there is something wrong with your graphics card and if you don't handle the chance is very high that your Graphics Card will continue to decline to the point where you can't even use your computer anymore.

I'm also pretty clueless why you aren't able to use your computer with HW acceleration while you can watch a video just fine, perhaps you could consider turning off DWM if you are using it as that could be the culprit sofware-wise and doesn't need you to turn HW acceleration off anymore.

However, this is essence a hardware problem so you might plan on upgrading at least your Graphics Card; or at least keep some budget aside for it, in case it decides to fail sooner or later...

How one automates it anyway...

You should be able to get around with AutoIt.

In the Documentation, you'll find tutorials on basic things. The first three should suffice to understand how to respond to Window events.

Then, it's just a matter of making a WHILE loop in which you wait for the window to be active, then enable HW acceleration, then wait for the window to be inactive, then disable HW acceleration; after which the loop repeats. That way, whenever you watch a video it's accelerated and otherwise it is not.

If you did the installation tutorial, you can easily automatically perform the actions to turn the HW acceleration on and off, it might be required to provide Tab to SendKeys in order to get to the slider. After which you can probably send a left or right arrow (perhaps a few times?) to slide it in the right direction.

As I'm thinking that you are referring to the HW acceleration feature of your graphics card, I can't write this for you as I don't have your graphics card and in the most cases don't even have its drivers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top