A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

# of Colors



 
 
Thread Tools Display Modes
  #1  
Old June 7th, 2004, 06:25 PM
Dave Ruhl
external usenet poster
 
Posts: n/a
Default # of Colors

Is there a way, in Access 2002, to determine the # of
colors the graphics card is currently set to ? Thanks...
  #2  
Old June 7th, 2004, 08:43 PM
Stephen Lebans
external usenet poster
 
Posts: n/a
Default # of Colors

You should learn how to search on GoogleGroups as it is an invaluable
tool.

From: Tom Esh )
Subject: GetDeviceCaps


View this article only
Newsgroups: microsoft.public.vb.winapi
Date: 2002-09-17 01:56:10 PST


On Tue, 17 Sep 2002 02:59:55 -0400, "Jon Wayn"
wrote:
I wish you would just jot down an example for me so i can see actual
parameters. the thing is: in the examples i have seen, parameters, such

as
Form1.hdc or just hDC, are passed. Forms do not have an hdc property

and
these variables are not declared in the examples. So, being new (a

complete
novice) to API, I just dont get it. Please show me a practical example


What language are you working in? VB forms ~do~ have a hDC property.
Anyhow if the app has no forms, to fetch display device caps ~any~
window's DC will do, including the desktop.
For example to retreive the current system color depth (bits):

'declares...
Public Const BITSPIXEL = 12
Public Declare Function GetDeviceCaps Lib "gdi32" _
(ByVal hdc As Long, ByVal nIndex As Long) As Long
Public Declare Function GetDC Lib "user32" _
(ByVal hwnd As Long) As Long
Public Declare Function ReleaseDC Lib "user32" _
(ByVal hwnd As Long, ByVal hdc As Long) As Long
Public Declare Function GetDesktopWindow Lib "user32" () As Long

'usage...
Dim hwndDesk As Long, DC As Long
hwndDesk = GetDesktopWindow()
DC = GetDC(hwndDesk)
Debug.Print GetDeviceCaps(DC, BITSPIXEL)
ReleaseDC hwndDesk, DC




--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"Dave Ruhl" wrote in message
...
Is there a way, in Access 2002, to determine the # of
colors the graphics card is currently set to ? Thanks...


  #3  
Old June 7th, 2004, 09:39 PM
Dave Ruhl
external usenet poster
 
Posts: n/a
Default # of Colors

Thanks Stephen, I tried this code and, though it didn't
give me the # of colors (256, 16 million, etc...) it does
tell me the bits (8, 32, etc...) which will work just as
well for me. Thanks !

BTW, I did try searching GoogleGroups and your website
and didn't find anything. Maybe I was just using the
wrong parameters.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:17 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.