Click here to Skip to main content
13,298,655 members (53,609 online)
Click here to Skip to main content
Add your own
alternative version


33 bookmarked
Posted 30 Jan 2003

Colour Picker Control for Windows CE

, 5 Feb 2003
Rate this:
Please Sign up or sign in to vote.
An implementation of the Office 97 style Colour Picker control for Windows CE.

Sample Image - CeColourPicker.jpg


This is a port of Chris Maunder's Office 97 style Colour Picker control[^] to Windows CE (PocketPC 2002). The code was adapted using the preprocessor macro _WIN32_WCE to enable transparent compilation in both eVC++ 3.0 and VC++ 6.0.


Here are the main points of the port.

Compatibility between CE and Desktop versions has been maintained through the precompiler, using the _WIN32_WCE #define.

The CE version of the popup is statically allocated in CColourPicker because CE does not support the WM_NCDESTROY message, making it impossible to dynamically delete the popup. This required the addition of a number of property set methods.

The popup is dismissed when the user clicks the button a second time, assuming a selection ended with cancel behavior.

The custom text button is not used to show up the CColorDialog. This class is not supported in MFC for the PocketPC 2002 SDK. One can still use the built in ChooseColor API, but the results are not very nice (see comment in the source code). The text changed to "Cancel".

WM_MOUSEMOVE is not used to make the color selection. CE has no mouse support and it would not be intuitive for a user to drag the pen just to start selecting the color. It has been replaced by WM_LBUTTONDOWN, and the handler code is the same.

This code has been tested in the PocketPC 2002 platform, compiles with no errors or warnings in Level 3 of eVC++ 3.0.


  • 2003-02-06: Changed the OnKillFocus handler of CColourPopup in order to allow the popup to close when it loses focus.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

João Paulo Figueira
Software Developer (Senior) Frotcom International
Portugal Portugal
I work on R&D for Frotcom International, a company that develops web-based fleet management solutions.

You may also be interested in...


Comments and Discussions

Generalthe "X" button Pin
paraGOD26-Dec-05 22:48
memberparaGOD26-Dec-05 22:48 
GeneralRe: the "X" button Pin
João Paulo Figueira27-Dec-05 0:39
memberJoão Paulo Figueira27-Dec-05 0:39 
GeneralRe: the "X" button Pin
paraGOD28-Dec-05 20:41
memberparaGOD28-Dec-05 20:41 
GeneralRe: the "X" button Pin
João Paulo Figueira29-Dec-05 0:08
memberJoão Paulo Figueira29-Dec-05 0:08 
On the Pocket PC you should get a WM_SIZE message with a minimize option. But you can also try this:
QA: How can I close my application by clicking the smart minimize (X) button?[^]

João Paulo Figueira
Embedded MVP
GeneralRe: the "X" button Pin
paraGOD29-Dec-05 19:59
memberparaGOD29-Dec-05 19:59 
QuestionCrashes under Windows Mobile 2003? Pin
gniemcew25-Aug-04 15:51
membergniemcew25-Aug-04 15:51 
AnswerRe: Crashes under Windows Mobile 2003? Pin
João Paulo Figueira25-Aug-04 23:17
memberJoão Paulo Figueira25-Aug-04 23:17 
GeneralSource code for the example Pin
biswa7-Mar-03 0:06
memberbiswa7-Mar-03 0:06 
GeneralRe: Source code for the example Pin
João Paulo Figueira7-Mar-03 0:51
memberJoão Paulo Figueira7-Mar-03 0:51 
GeneralRe: Source code for the example Pin
biswa7-Mar-03 1:21
memberbiswa7-Mar-03 1:21 
GeneralRe: Source code for the example Pin
bm_masri17-Nov-03 17:55
memberbm_masri17-Nov-03 17:55 
GeneralRe: Source code for the example Pin
Daniel Jin24-Apr-05 5:06
memberDaniel Jin24-Apr-05 5:06 
GeneralGreat job! Pin
Daniel S.31-Jan-03 6:59
memberDaniel S.31-Jan-03 6:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171207.1 | Last Updated 6 Feb 2003
Article Copyright 2003 by João Paulo Figueira
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid