Page 1 of 1

Posted: Wed Apr 02, 2003 8:13 pm
by BackupUser
Restored from previous forum. Originally posted by darklordz.

I created a 3d game launcher using teh help of the following snippet

Code: Select all

Structure DISPLAY_DEVICE
   cb.l
   DeviceName.b[32]
   DeviceString.b[128]
   StateFlags.l
   DeviceID.b[128]
   DeviceKey.b[128]
EndStructure 

dd.DISPLAY_DEVICE\cb=SizeOf(DISPLAY_DEVICE)


cr.s=Chr(10)
id.l=0
While EnumDisplayDevices_(0,id,@dd,0)
  devname$=PeekS(@dd\DeviceName[0])
  devstring$=PeekS(@dd\DeviceString[0])
  devid$=PeekS(@dd\DeviceID[0])
  devkey$=PeekS(@dd\DeviceKey[0])
  MessageRequester("",devname$+cr+devstring$+cr+devid$+cr+devkey$,0)
  id=id+1 
Wend
this code retreives all data from a registry folder. That folder ontains otehr drivers like NetMeeting driver. How do I get Just Display Drivers noting else ? Requires Windows 2000 or later; Win9x/ME: Not supported, The EnumDisplayDevices function lets you obtain information about the display devices in a system.

Declare Function EnumDisplayDevices Lib "user32" Alias "EnumDisplayDevicesA" (Unused As Any, ByVal iDevNum As Long, lpDisplayDevice As DISPLAY_DEVICE, ByVal dwFlags As Long) As Boolean

Posted: Thu Apr 03, 2003 6:18 pm
by BackupUser
Restored from previous forum. Originally posted by Hi-Toro.

I used this code a while back myself, and this seems to work for me (filtering out the "mirroring device" drivers)...

Code: Select all

#DISPLAY_DEVICE_ATTACHED_TO_DESKTOP =$01
#DISPLAY_DEVICE_MULTI_DRIVER        =$02
#DISPLAY_DEVICE_PRIMARY_DEVICE      =$04
#DISPLAY_DEVICE_MIRRORING_DRIVER    =$08
#DISPLAY_DEVICE_VGA                 =$10

Structure DISPLAY_DEVICE
   cb.l
   DeviceName.b[32]
   DeviceString.b[128]
   StateFlags.l
   DeviceID.b[128]
   DeviceKey.b[128]
EndStructure 

dd.DISPLAY_DEVICE\cb=SizeOf(DISPLAY_DEVICE)

cr.s=Chr(10)
id.l=0
While EnumDisplayDevices_(0,id,@dd,0)
  If dd\StateFlags &~ #DISPLAY_DEVICE_MIRRORING_DRIVER
;    devname$=PeekS(@dd\DeviceName[0])
    devstring$=PeekS(@dd\DeviceString[0])
;    devid$=PeekS(@dd\DeviceID[0])
;    devkey$=PeekS(@dd\DeviceKey[0])
    MessageRequester("",devname$+cr+devstring$+cr+devid$+cr+devkey$,0)
  EndIf
    id=id+1 
Wend 

--
See ya,
James L Boyd.
http://www.hi-toro.com/
--

Posted: Thu Apr 03, 2003 7:36 pm
by BackupUser
Restored from previous forum. Originally posted by darklordz.

Well Yea but i uses windows api that is not supported in win 9x/me....

i also filtered it out. but there are numerous mirror devices that i don't know of and i only have 2 machines to test on....
These are 2 problems with the function...