Help: Determining system color mode... 
Author Message
 Help: Determining system color mode...

Is there an API call that you can use to return which color mode windows is
currently using? For example, how to determine if your machine is using 256
colors, 16 bit color, 24 bit color, 32 bit color, etc?

Any help would be greatly appreciated.

Thanks in advance,

Trev



Sun, 08 Apr 2001 03:00:00 GMT  
 Help: Determining system color mode...
Try GetDeviceCaps!

Option Explicit
Private Declare Function CreateIC Lib "gdi32" Alias "CreateICA" (ByVal
lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As
String, ByVal lpInitData As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal
nIndex As Long) As Long
Private Const BITSPIXEL = 12

Private Sub Form_Click()
    Dim lDC As Long

    lDC = CreateIC("DISPLAY", vbNullString, vbNullString, ByVal 0&)
    Debug.Print "Color Bits "; GetDeviceCaps(lDC, BITSPIXEL)
    Call DeleteDC(lDC)
End Sub

Quote:

>Is there an API call that you can use to return which color mode windows is
>currently using? For example, how to determine if your machine is using 256
>colors, 16 bit color, 24 bit color, 32 bit color, etc?

>Any help would be greatly appreciated.

>Thanks in advance,

>Trev



Sun, 08 Apr 2001 03:00:00 GMT  
 Help: Determining system color mode...
Check out the code at:

http://www.geocities.com/siliconvalley/6304/css

Free!



Quote:
>Try GetDeviceCaps!

>Option Explicit
>Private Declare Function CreateIC Lib "gdi32" Alias "CreateICA" (ByVal
>lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As
>String, ByVal lpInitData As Long) As Long
>Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
>Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long,
ByVal
>nIndex As Long) As Long
>Private Const BITSPIXEL = 12

>Private Sub Form_Click()
>    Dim lDC As Long

>    lDC = CreateIC("DISPLAY", vbNullString, vbNullString, ByVal 0&)
>    Debug.Print "Color Bits "; GetDeviceCaps(lDC, BITSPIXEL)
>    Call DeleteDC(lDC)
>End Sub


>>Is there an API call that you can use to return which color mode windows
is
>>currently using? For example, how to determine if your machine is using
256
>>colors, 16 bit color, 24 bit color, 32 bit color, etc?

>>Any help would be greatly appreciated.

>>Thanks in advance,

>>Trev



Tue, 10 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Determine Color Mode (16, 256, 16k) of Windows

2. Determine Color Mode (16, 256, 16k) of Windows

3. Determine system color depth?

4. Determining system color setting

5. How to determine how many colors the system has been set to

6. Determining system color setting

7. Determining current system color setting

8. Custom 24-bit colors in 256-color mode

9. colors wrong in 256 color mode

10. Still need help with palette for 256 color mode

11. HELP - detecting if windows in 256 or 16-bit color modes

12. HELP ON 256 color mode gdi32 bug!!!

 

 
Powered by phpBB® Forum Software