Board index » delphi » Desktop Colors

Desktop Colors

Can anyone tell me how to programmatically find the number of colors the
desktop is currently set for?

Thanks,
Jason
{*word*104}o...@remove-hotmail.com

 

Re:Desktop Colors


Quote
Jason wrote:

> Can anyone tell me how to programmatically find the number of colors the
> desktop is currently set for?

> Thanks,
> Jason
> {*word*104}o...@remove-hotmail.com

GetSysColor and SetSysColor

Alex
--
** Pepsi Cola and animal protection **
**  http://www.pepsi{*word*76}bath.com/  **

Author of the free Chatsystem PINO! || Website: http://www.alcomp.net
Available at http://pino.cjb.net    || Chat   : pinochat.dhs.org:8080

Re:Desktop Colors


Thank you.

Quote
"Alexander Mueller" <al...@gmx.at> wrote in message

news:38BDBB93.59E4B730@gmx.at...
Quote
> Jason wrote:

> > Can anyone tell me how to programmatically find the number of colors the
> > desktop is currently set for?

> > Thanks,
> > Jason
> > {*word*104}o...@remove-hotmail.com

> GetSysColor and SetSysColor

> Alex
> --
> ** Pepsi Cola and animal protection **
> **  http://www.pepsi{*word*76}bath.com/  **

> Author of the free Chatsystem PINO! || Website: http://www.alcomp.net
> Available at http://pino.cjb.net    || Chat   : pinochat.dhs.org:8080

Re:Desktop Colors


Thank you but I don't think this is what I'm looking for. At least the Win32
API help file doesn't look like it pertains to this. I'm looking for a way
to see if Windows is set for 256, 65536, ect colors.

Jason

Quote
"Alexander Mueller" <al...@gmx.at> wrote in message

news:38BDBB93.59E4B730@gmx.at...
Quote
> Jason wrote:

> > Can anyone tell me how to programmatically find the number of colors the
> > desktop is currently set for?

> > Thanks,
> > Jason
> > {*word*104}o...@remove-hotmail.com

> GetSysColor and SetSysColor

> Alex
> --
> ** Pepsi Cola and animal protection **
> **  http://www.pepsi{*word*76}bath.com/  **

> Author of the free Chatsystem PINO! || Website: http://www.alcomp.net
> Available at http://pino.cjb.net    || Chat   : pinochat.dhs.org:8080

Re:Desktop Colors


Jason schrieb:

Quote

> Can anyone tell me how to programmatically find the number of colors the
> desktop is currently set for?

procedure TForm1.Button1Click(Sender: TObject);
var
  Bits: Integer;
  Colors: Integer;
begin
  Bits:=GetDeviceCaps(Canvas.Handle, BITSPIXEL);
  Colors:=1 shl Bits;
  ShowMessage(IntToStr(Colors));
end;

HTH
-Michael

Re:Desktop Colors


Quote
Jason wrote:

> Thank you but I don't think this is what I'm looking for. At least the Win32
> API help file doesn't look like it pertains to this. I'm looking for a way
> to see if Windows is set for 256, 65536, ect colors.

> Jason

Sorry I thought you want to get the color values. Anyway, Michael gave
you already the correct function.

Alex
--
** Pepsi Cola and animal protection **
**  http://www.pepsi{*word*76}bath.com/  **

Author of the free Chatsystem PINO! || Website: http://www.alcomp.net
Available at http://pino.cjb.net    || Chat   : pinochat.dhs.org:8080

Re:Desktop Colors


Thank you.

Quote
"Michael Winter" <m...@aquila.de> wrote in message

news:38BE8B27.B4022B55@aquila.de...
Quote
> Jason schrieb:

> > Can anyone tell me how to programmatically find the number of colors the
> > desktop is currently set for?

> procedure TForm1.Button1Click(Sender: TObject);
> var
>   Bits: Integer;
>   Colors: Integer;
> begin
>   Bits:=GetDeviceCaps(Canvas.Handle, BITSPIXEL);
>   Colors:=1 shl Bits;
>   ShowMessage(IntToStr(Colors));
> end;

> HTH
> -Michael

Other Threads