c# - Programmatically determine if system has switchable graphics -


we struggling following problem on laptops switchable graphics (amd radeon 7670m + intel 4000) in our wpf application:

the d3dimage use display video shows black frame. happens when discrete graphics (amd) active application (mode set high performance). intel graphics active (mode set power saving) works. looks not alone issue. search on google revealed following posts in amd forums:

i have found workaround using d3dimage.copybackbuffer - looks backbuffer indeed contain right frame - try display instead.

but in order apply workaround when necessary, brings me subject of question: how find out if system has switchable graphics?
suppose there might ways using wmi or looking through registry, glad if point me in right direction or might have example how so.

update:

i have tried enumdisplaydevices , system.management.managementobjectsearcher. first not returning devices while latter does. perhaps there still better way?

combining this question , this one solution use system.management this:

internal class program {     private static void main(string[] args)     {         managementobjectsearcher searcher = new managementobjectsearcher("select * win32_videocontroller");         var mos = searcher.get();         foreach (managementobject mo in mos)         {             foreach (propertydata property in mo.properties)             {                 if (property.name == "description")                 {                     console.writeline(property.value);                 }             }         }         console.readkey();     } } 

my hardware is:

enter image description here

and result is:

enter image description here

since have not-really-hardware device called "dameware development mirror" can @ videoprocessor property. nvidea , intel have value, non-existing device there null.

if (property.name == "description")    console.writeline(property.value); if (property.name == "videoprocessor")    console.writeline(property.value); 

enter image description here

and determine active videocard can check if "currentbitsperpixel" property has value


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -