need help! tying to create a ColorDialog

Hello, I am making a GUI application with c + + Visual Studio 2010.
I have to use "application windows" I can not use "windows forms" (which automatically has the option of "ColorDialog" tools).

In the main window, a menu option, you should be changing color, so I have to show the color palette using ColorDialog.
My problem is I do not know what I need to write code within the event "click that option" and then use the selected color.

If someone could help me, I appreciate it. Thanks in advance.
Last edited on
As for palette information (From MSDN):
 
The Color dialog box does not support palettes. The color choices offered by the dialog box are limited to the system colors and dithered versions of those colors.


The ColorDialog can be displayed in plain WIN32 by calling the ChooseColor() function:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646912(v=vs.85).aspx
Thank you :)

I have a new problem.

The color selected is in: hbrush (HBRUSH hbrush)

http://msdn.microsoft.com/en-us/library/windows/desktop/ms646829%28v=vs.85%29.aspx#choosing_color


To create the colorpen (manual) (in example):

LOGBRUSH ColorPen = { BS_SOLID,0x00FF00FF,0 };
NewColorPen = ExtCreatePen(PS_GEOMETRIC,5,&ColorPen,0,NULL);

This example runs well. But I try to use the color "hbrush" to create de NewColorPen.
But I can't get it.

Opinions?
Topic archived. No new replies allowed.