;==============================================================================
include \masm32\include\masm32rt.inc
;==============================================================================
.data
hwndCon dd 0
hdcCon dd 0
.code
;==============================================================================
start:
;==============================================================================
invoke GetConsoleWindow
mov hwndCon, eax
printf("hwndCon %X\n",eax)
invoke GetDC, hwndCon
mov hdcCon, eax
printf("hdcCon %X\n",eax)
invoke GetDeviceCaps, hdcCon, SIZEPALETTE
printf("SIZEPALETTE %d\n\n",eax)
invoke GetDeviceCaps, hdcCon, RASTERCAPS
mov ebx, eax
; RC_BANDING Requires banding support.
.IF ebx & RC_BANDING
printf("RC_BANDING\n")
.ENDIF
; RC_BITBLT Capable of transferring bitmaps.
.IF ebx & RC_BITBLT
printf("RC_BITBLT\n")
.ENDIF
; RC_BITMAP64 Capable of supporting bitmaps larger than 64 KB.
.IF ebx & RC_BITMAP64
printf("RC_BITMAP64\n")
.ENDIF
; RC_DI_BITMAP Capable of supporting the SetDIBits and GetDIBits functions.
.IF ebx & RC_DI_BITMAP
printf("RC_DI_BITMAP\n")
.ENDIF
; RC_DIBTODEV Capable of supporting the SetDIBitsToDevice function.
.IF ebx & RC_DIBTODEV
printf("RC_DIBTODEV\n")
.ENDIF
; RC_FLOODFILL Capable of performing flood fills.
.IF ebx & RC_FLOODFILL
printf("RC_FLOODFILL\n")
.ENDIF
; RC_PALETTE Specifies a palette-based device.
.IF ebx & RC_PALETTE
printf("RC_PALETTE\n")
.ENDIF
; RC_SCALING Capable of scaling.
.IF ebx & RC_SCALING
printf("RC_SCALING\n")
.ENDIF
; RC_STRETCHBLT Capable of performing the StretchBlt function.
.IF ebx & RC_STRETCHBLT
printf("RC_STRETCHBLT\n")
.ENDIF
; RC_STRETCHDIB Capable of performing the StretchDIBits function
.IF ebx & RC_STRETCHDIB
printf("RC_STRETCHDIB\n\n")
.ENDIF
inkey
exit
;==============================================================================
end start
I’m not sure what to make of the GetDeviceCaps-RASTERCAPS return value. The console is not a palette-based device, but apparently supports bitmaps.
hwndCon 102D4
hdcCon E2010545
SIZEPALETTE 0
RC_BITBLT
RC_BITMAP64
RC_DI_BITMAP
RC_DIBTODEV
RC_FLOODFILL
RC_STRETCHBLT
RC_STRETCHDIB