Sometimes, you will need to determine if your application is running on a device with a color screen. This ultra-sleek C routine returns true if your app runs on a handheld with a color screen:


Boolean hasColorCrt()
{
Boolean enableColor;
WinScreenMode(winScreenModeGet, NULL,NULL, NULL,&enableColor );
return enableColor;
}

It was tested on a OS4 Palm V, a Tungsten T3 and a Tungsten E2. It compiled perfectly in PODS 1.1 and OnBoardC. Feel free to use it in your apps!

Related posts:

  1. Detecting vibrators and alarm leds programmatically
  2. FossilIsWristPDADevice causes (Sys 0505) (0,1092) error on non-WristPDA devices
  3. High color resolution screens-what the Windows Mobile team has to say
  4. malloc and free for Palm OS
  5. Determining if a handheld has a rectangular screen

2 Responses to “Detecting color screens programatically”

  1. Don’t feel pissed on. But I think there are no PalmOS-Devices with a CTR (cathode ray tube).

    Stefan

  2. Hi Stefan,
    thanks for pointing this out.

    I was probably very tired when I coded this routine..it was at school IMHO(it is part of BinaryClock-the binary clock for Palm OS) and I was very, very bored!

    Best regards
    Tam Hanna

    P.s. Dont feel pissed on yourself-but its CRT, not CTR;)

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

© 2012 TamsPalm - the Palm OS / web OS Blog Suffusion theme by Sayontan Sinha