forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to get COLORs

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sun Jan 01, 2006 1:37 am    Post subject: How to get COLORs Reply with quote

%%ScreenHeight = @sysinfo(screenheight)
%%ScreenWidth = @sysinfo(screenwidth)
%%Colours = ?
info Current display resolution:@CR()%%ScreenWidth x %%ScreenHeight x %%Colours

Any IDEA ?
Back to top
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sun Jan 01, 2006 9:50 am    Post subject: Reply with quote

What colors are you needing...system colors?

If it's System colors, look in the registryat "HKEY_CURRENT_USER\Control Panel\Colors" and you can use @REGREAD() to get the value you're looking for.
Back to top
View user's profile Send private message Send e-mail
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Sun Jan 01, 2006 1:44 pm    Post subject: Reply with quote

32 bit
16 bit
8 bit
you know Windows(TM) desktop color setting

My registry only have this -> HKEY_CURRENT_USER\Conrol Panel\Desktop
Back to top
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sun Jan 01, 2006 7:46 pm    Post subject: Reply with quote

What OS are you using?
Back to top
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sun Jan 01, 2006 7:56 pm    Post subject: Reply with quote

On my XP system the video resolution settings are found at:

"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Control\VIDEO\{475FCFF4-B046-48A0-BA4D-74223B099163}\0000"
Back to top
View user's profile Send private message Send e-mail
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Mon Jan 02, 2006 7:38 am    Post subject: Reply with quote

XP i have

NO and no

Every display card have its own mambo jumbo i need something universal

Somewhere this most be writen

DirectX have it..

Control panel have it..

Mybe some API calls or ???

Thanks anyway...
Back to top
View user's profile Send private message Send e-mail
henrywood
Contributor
Contributor


Joined: 21 Sep 2004
Posts: 66
Location: Copenhagen, Denmark

PostPosted: Mon Jan 02, 2006 9:29 pm    Post subject: Reply with quote

Hi filip !


I seem to remember that Tommy's vdsutil.dll can return resolution and colour depth and change them on the fly as well

Hope this helps


Henrik
Back to top
View user's profile Send private message Send e-mail
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Wed Jan 04, 2006 7:27 pm    Post subject: Reply with quote

Try this:
Code:

  loadlib user32
  loadlib gdi32
  %h = @lib(user32,GetDesktopWindow,int:,)
  %d = @lib(user32,GetDC,INT:,%h)
  %%depth = @lib(GDI32,GetDeviceCaps,int:,%d,12)
  %x = @lib(user32,ReleaseDC,int:,%h,%d)
  freelib user32
  freelib gdi32
  info The color depth is %%depth "bits"
  exit


Hope that helps...
Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Wed Jan 04, 2006 10:32 pm    Post subject: Reply with quote

SOLUTION

Code:
 loadlib user32
  loadlib gdi32
  %h = @lib(user32,GetDesktopWindow,int:,)
  %d = @lib(user32,GetDC,INT:,%h)
  %%ColorDepth = @lib(GDI32,GetDeviceCaps,int:,%d,12)
  %x = @lib(user32,ReleaseDC,int:,%h,%d)
  freelib user32
  freelib gdi32

  %%ScreenHeight = @sysinfo(screenheight)
  %%ScreenWidth = @sysinfo(screenwidth)
   info Current display resolution:@CR()%%ScreenWidth x %%ScreenHeight x %%ColorDepth bit
   exit

Thanks...
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group