APIを扱うのは久方ぶりなので間違ってるかもしれませんが
#uselib "user32.dll"
;user32.asよりコピペ
#define global EnumDisplayDevices EnumDisplayDevicesA
#func global EnumDisplayDevicesA "EnumDisplayDevicesA" sptr,sptr,sptr,sptr
/*
EnumDisplayDevices関数
https://msdn.microsoft.com/ja-jp/library/cc428500.aspx?f=255&MSPPError=-2147217396
Type DISPLAY_DEVICE
cbSize As Long '構造体のサイズ
DeviceName As String * 32 'デバイス名
DeviceString As String * 128 'デバイス名の文字列
StateFlags As Long '常に(0)
DeviceID As String * 128 'デバイスID
DeviceKey As String * 128 'デバイスキー
End Type
http://tokovalue.jp/Structure.htm#DISPLAY_DEVICE%E6%A7%8B%E9%80%A0%E4%BD%93より引用
*/
//以下テスト------
notesel DeviceData
repeat
ThisDisplayNum = cnt
sdim DISPLAY_DEVICE, 424 ;(4+32+128+4+128+128)=424byte
lpoke DISPLAY_DEVICE, 0, 424 ;構造体のサイズを指定しておく
EnumDisplayDevices 0,ThisDisplayNum,varptr(DISPLAY_DEVICE),0 ;構造体のポインタはvarptrで渡す
if stat = 0 :break
noteadd "DevNum= " + cnt
sdim DeviceName, 32
memcpy DeviceName, DISPLAY_DEVICE, 32, 0, 4 ;構造体から情報を取り出す
noteadd "DeviceName= "+DeviceName
sdim DeviceString, 128
memcpy DeviceString, DISPLAY_DEVICE, 128, 0, 36
noteadd "DeviceString= " + DeviceString
sdim DeviceID, 128
memcpy DeviceID, DISPLAY_DEVICE, 128, 0, 168
noteadd "DeviceID= " + DeviceID
sdim DeviceKey, 128
memcpy DeviceKey, DISPLAY_DEVICE, 128, 0, 296
noteadd "DeviceKey= " + DeviceKey
noteadd "\n"
loop
mesbox DeviceData, 640, 480, 4