Guys,
In response for how to set the video resolution osing VFP from Tanvir, I've
Just been playing around with a small program to extract the monitor and
screen attributes via VFP. I haven't looked at how to set the attributes at
the moment but thought that this may well be useful to some of you out
there:

* Program to 
* Browse the Video attributes and screen 
* resolution
Create Cursor curAttrib_Video(ID C(30), Property C(30), Property_Type C(1),
Num_Value N (9,4) null, Char_Value C(64) null)

oService=Getobject("winmgmts:\\.\root\cimv2")
oCollection=oService.ExecQuery("select * from win32_videoController")

For each oItem in oCollection
        cId=oItem.Name
        
        For each oProperty in oItem.Properties_
                Do case
                Case VarType(oProperty.Value)="C"
                        cProperty_Type="C"
                        cValue=oProperty.Value
                        nValue=null
                        *
                Case VarType(oProperty.Value)="N"
                        cProperty_Type="N"
                        cValue=Transform(oProperty.Value)
                        nValue=oProperty.Value
                        *
                Otherwise
                        cProperty_Type="U"
                        cValue=null
                        nValue=null
                        *
                EndCase
                
                        
                Insert into curAttrib_Video (Id, Property, Property_Type,
Char_Value, Num_Value) ;
                                        values (cId, oProperty.Name,
cProperty_Type, cValue, nValue)
        EndFor
        
EndFor
Browse


Create Cursor curAttrib_Monitor(ID C(30), Property C(30), Property_Type
C(1), Num_Value N (9,4) null, Char_Value C(64) null)
oCollection=oService.ExecQuery("select * from win32_DesktopMonitor")

For each oItem in oCollection
        cId=oItem.Name
        
        For each oProperty in oItem.Properties_
                Do case
                Case VarType(oProperty.Value)="C"
                        cProperty_Type="C"
                        cValue=oProperty.Value
                        nValue=null
                        *
                Case VarType(oProperty.Value)="N"
                        cProperty_Type="N"
                        cValue=Transform(oProperty.Value)
                        nValue=oProperty.Value
                        *
                Otherwise
                        cProperty_Type="U"
                        cValue=null
                        nValue=null
                        *
                EndCase
                
                        
                Insert into curAttrib_Monitor(Id, Property, Property_Type,
Char_Value, Num_Value) ;
                                        values (cId, oProperty.Name,
cProperty_Type, cValue, nValue)
        EndFor
        
EndFor
Browse


Dave Crozier
 





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to