Post Reply

Forums -> UltraMon™ SDK -> programming examples question
chris   2007-01-19 10:47
On the programming page ( you've got two examples of getting monitor info (the SysInfo scripts). My question is, there's a middle section that doesn't seem to do anything, could you explain it?

Code (vb example):
ddMon.cb = Len(ddMon)
Dim devMon As Long
devMon = 0

'please note that this enumeration may not return the correct monitor if multiple monitors
'are attached. this is because not all display drivers return the ACTIVE flag for the monitor
'that is actually active

Do While EnumDisplayDevices(dd.DeviceName, devMon, ddMon, 0) <> 0
If CBool(ddMon.StateFlags And DISPLAY_DEVICE_ACTIVE) Then Exit Do
devMon = devMon + 1

If CStrToVBStr(ddMon.DeviceString) = "" Then
EnumDisplayDevices dd.DeviceName, 0, ddMon, 0
If CStrToVBStr(ddMon.DeviceString) = "" Then ddMon.DeviceString = "Default Monitor"
End If
chris   2007-01-19 10:48
I thought I should just clarify... the above code doesn't seem to have any impact on the rest of the script, what is it's purpose???
chris   2007-01-19 11:03
nevermind, i figured it out ;)
Forums -> UltraMon™ SDK -> programming examples question

Post Reply