00001 #ifndef __CLRDLG_H__ 00002 #define __CLRDLG_H__ 00003 00004 #include <windows.h> 00005 #include <commctrl.h> 00006 #include <stdlib.h> 00007 #include <stdio.h> 00008 #include <assert.h> 00009 #include "resource.h" 00010 00011 00012 /* FUNCTION: ChooseColorsDialog() 00013 00014 Activates a modal color selection dialog box for multiple items. 00015 00016 PARAMETERS: 00017 00018 hInstance: 00019 Instance of the executable passed to WinMain(). 00020 00021 hOwner : 00022 The parent window of the dialog. 00023 00024 numItems : 00025 The number of items for which colors are being selected. 00026 00027 itemNames : 00028 String descriptions of the items, e.g. "background". 00029 00030 itemColors : 00031 The current color of the items before the dialog is activated. 00032 If the function returns non-zero then this array also contains 00033 the new colors of the items selected by the user. 00034 00035 defaultColors : 00036 The default color of the items. i.e. the preferred color. 00037 00038 selectedItem : 00039 The initially selected item displayed in the dialog. 00040 00041 onApply : 00042 Callback function when the user hits the apply button. 00043 The current selected item and color are passed to the 00044 function. 00045 00046 RETURNS: Non-zero if the user hits the OK button, else zero. 00047 */ 00048 00049 00050 int ChooseColorsDialog 00051 ( 00052 HINSTANCE hInstance, 00053 HWND hOwner, 00054 const unsigned numItems, 00055 const char **itemNames, 00056 COLORREF *itemColors, 00057 const COLORREF *defaultColors, 00058 const unsigned selectedItem, 00059 void ( *onApply )( const unsigned item, const COLORREF color ) 00060 ); 00061 00062 00063 #endif/* __CLRDLG_H__ */
1.5.8