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 


Way to find display properties?

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


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Sep 23, 2003 7:27 pm    Post subject: Way to find display properties? Reply with quote

Is there a way in VDS to determine if the computer the program is running on is set to 256 colors, 16-bit color, etc?
_________________
Joe Floyd
Back to top
View user's profile Send private message
Rebel49
Contributor
Contributor


Joined: 23 Aug 2002
Posts: 78
Location: Nova Scotia, Canada

PostPosted: Tue Sep 23, 2003 11:34 pm    Post subject: Reply with quote

Well the registry is mostly a mystery to me but
this seems to work on my Win98SE buggy.

Code:

%T = @regread(local,Config\0001\Display\Settings,BitsPerPixel)
info Display color depth is %T Bits Per Pixel


REB

_________________
OLD and eager!
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed Sep 24, 2003 2:42 pm    Post subject: Reply with quote

Thanks for the reply -

doesn't seem to work on Win ME. Haven't tried it elsewhere. Any other ideas?

_________________
Joe Floyd
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed Sep 24, 2003 2:46 pm    Post subject: Reply with quote

I checked with regedit and found that on my machine if you change the 0001 in your example to 0003 it works. 0001 is not set at all and 0002 is set to a different pixel depth. I guess it has something to do with users?
_________________
Joe Floyd
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed Sep 24, 2003 2:52 pm    Post subject: Reply with quote

I found a key that seems to hold the correct value - but it is in the HKEY_CURRENT_CONFIG section of the registry. I don't know much about registry issues, but when I looked up @regread() in the VDS help file, it looks like this section of the registry isn't accessible - is this right?
_________________
Joe Floyd
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Wed Sep 24, 2003 5:51 pm    Post subject: Reply with quote

It seems to me that the @sysinfo() function ought to be able to get this information, although the reason it doesn't is probably because at the time I couldn't think what use a VDS programmer would make of it.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed Sep 24, 2003 6:11 pm    Post subject: Reply with quote

My use is this:

I have some nice looking BitBTNS on my dialog that are 256 colors and look very nice under most displays set to High Color or True Color. A small number of users have their displays set to 256 colors for some reason, and the graphics look really bad on them. (I'm not sure exactly why, because they have less than 256 colors - but I guess it is not the SAME 256 colors as the users have.)

Anyway, I'd like to be able to just use regular buttons for any users with colors set to 256 and to have my program recognize their settings.

Thanks for any help you can offer.

(And I know that the help file says BitBtns should only have 16 colors, but these seem to work perfectly most of the time.)

_________________
Joe Floyd
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Sep 24, 2003 6:47 pm    Post subject: Reply with quote

I don't think there is need to fiddle with registry U can get it with API if using VDS 5.x or even otherwise. My idea is:
API GetDeviceCaps of Desktop window . Haven't ried yet.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Wed Sep 24, 2003 7:11 pm    Post subject: Reply with quote

Hi jwfv
I just made an example for VDS 5.x
For VDS 3/4 U can use Gadget or vdsug.dll to use tthe example.
BTW I think it would be nice to post the VDS version when asking a question.
Never mind.

All API calls are inside DSU. So very easy to use.
http://codescript.vdsworld.com/VDS5src/screncolordepth.zip
Disclaimer: Use at your own risk.
EDIT:
Just for info:
If resolution is 256 colors it returns 8 bits.
If 16 colors 1 bit.

Enjoy.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension


Last edited by CodeScript on Thu Sep 25, 2003 4:22 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed Sep 24, 2003 8:56 pm    Post subject: Reply with quote

This looks great! I will try it in my application (VDS5 by the way) and see if it gives the information needed. Thanks for the quick reply and help -
_________________
Joe Floyd
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Wed Sep 24, 2003 9:55 pm    Post subject: Reply with quote

That .dsu works great. Thanks for posting that. I've already coded it in the application - problem solved.
_________________
Joe Floyd
Back to top
View user's profile Send private message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Tue Jan 24, 2006 3:35 pm    Post subject: Reply with quote

Hi

VDS5 here..

I know this is an old page, but I have a map editor program that I use a lot only runs in 16bit mode in Windows XP and I leave XP in 32bit for everything else.
I need some way to switch from Highest(32) to 16bit and back and forth, cause its such a pain right clicking the desktop advanced settings thingy method.

Any ideas how to do this in a homemade vds program?

Thanks in advance
Back to top
View user's profile Send private message Visit poster's website
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