Modify

Opened 10 years ago

Closed 10 years ago

#1048 closed Bug (Fixed)

_WinAPI_EnumDisplayDevices() Example in Help-File wrong

Reported by: KaFu Owned by: Jpm
Milestone: 3.3.1.2 Component: Documentation
Version: 3.3.0.0 Severity: None
Keywords: Cc:

Description

; HiHo Devs,
; the example for _WinAPI_EnumDisplayDevices() in the help-file
; seems to be wrong. See attached function _Main_OLD() for the
; org example and _Main_NEW() for my proposed new example
; Best Regards

#AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <WinAPI.au3>
Opt('MustDeclareVars', 1)

_Main_OLD()

Func _Main_OLD()

Local $aDevice, $i = 0, $text
While 1

$aDevice = _WinAPI_EnumDisplayDevices("", $i)
If Not $aDevice[0] Then ExitLoop
$text = "Successful? " & $aDevice[0] & @LF
$text &= "Device (Adapter or Monitor): " & $aDevice[1] & @LF
$text &= "Description (Adapter or Monitor): " & $aDevice[2] & @LF
$text &= "Device State Flag: " & $aDevice[3] & @LF
Select

Case BitAND($aDevice[3], 32) = 32

$text &= @TAB & "- The device has more display modes than its output devices support" & @LF
ContinueCase

Case BitAND($aDevice[3], 16) = 16

$text &= @TAB & "- The device is removable; it cannot be the primary display" & @LF
ContinueCase

Case BitAND($aDevice[3], 8) = 8

$text &= @TAB & "- The device is VGA compatible" & @LF
ContinueCase

Case BitAND($aDevice[3], 4) = 4

$text &= @TAB & "- Represents a pseudo device used to mirror application drawing for remoting" & @LF
ContinueCase

Case BitAND($aDevice[3], 2) = 2

$text &= @TAB & "- The primary desktop is on the device" & @LF
ContinueCase

Case BitAND($aDevice[3], 1) = 1

$text &= @TAB & "- The device is part of the desktop" & @LF

EndSelect
$text &= "Plug and Play identifier string: " & $aDevice[4] & @LF
MsgBox(0, "", $text)
$i += 1

WEnd

EndFunc ;==>_Main

_Main_NEW()

Func _Main_NEW()

Local $aDevice, $i = 0, $text
While 1

$aDevice = _WinAPI_EnumDisplayDevices("", $i)
If Not $aDevice[0] Then ExitLoop
$text = "Successful? " & $aDevice[0] & @LF
$text &= "Device (Adapter or Monitor): " & $aDevice[1] & @LF
$text &= "Description (Adapter or Monitor): " & $aDevice[2] & @LF
$text &= "Device State Flag: " & $aDevice[3] & @LF
if BitAND($aDevice[3], 32) then $text &= @TAB & "- The device has more display modes than its output devices support" & @LF

if BitAND($aDevice[3], 16) then $text &= @TAB & "- The device is removable; it cannot be the primary display" & @LF
if BitAND($aDevice[3], 8) then $text &= @TAB & "- The device is VGA compatible" & @LF
if BitAND($aDevice[3], 4) then $text &= @TAB & "- Represents a pseudo device used to mirror application drawing for remoting" & @LF
if BitAND($aDevice[3], 2) then $text &= @TAB & "- The primary desktop is on the device" & @LF
if BitAND($aDevice[3], 1) then $text &= @TAB & "- The device is part of the desktop" & @LF

$text &= "Plug and Play identifier string: " & $aDevice[4] & @LF
MsgBox(0, "", $text)
$i += 1

WEnd

EndFunc ;==>_Main

Attachments (0)

Change History (1)

comment:1 Changed 10 years ago by Jpm

  • Milestone set to 3.3.1.2
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed in version: 3.3.1.2

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jpm.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.