Any suggestions?
Thanks,
AliR.
"Cameron_C" <Came...@discussions.microsoft.com> wrote in message
news:1C036565-C14D-46B4...@microsoft.com...
Cameron:
OnCreate() is not called for controls placed on a dialog template.
I personally would not have a control access the registry, but if you want to do
it why don't you do it in the constructor? The control does not have to be live
in order to cache the color values in member variables of the control.
--
David Wilkinson
Visual C++ MVP
Thank you!
"AliR" wrote:
> .
>
PreSubclassWIndow is called only if you have a control variable bound to the control; I
have never seen this fail. If you are using GetDlgItem and don't have a control variable,
that would be your problem.
joe
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
HKEY_CURRENT_USER\
Software\
VendorName\
ProductName\
DialogName\
ButtonColors\
ButtonID\
ColorName= RGBvalue
or
ColorName\
R=DWORD
G = DWORD
B = DWORD
so
HKCU\JMNCO\MyTestProgram\Settings\ButtonColors\101\Enabled=0xFF0000
HKCU\JMNCO\MyTestProgram\Settings\ButtonColors\101\Disabled=0x000000
Now the question is, how do you get the vendor name, product name, and the name of the
dialog ("Settings")? You have to somehow get that loaded first, and consequently, you are
back to having to set something in the button in the OnInitDialog handler (where
GetWindowText would give the name of the dialog) or in the OnInitialUpdate handler (where
you would need to figure out what the ID of the class was, e.g., the string value of
CYourClassName::IDD). So I don't see that just setting the colors at that point is a
problem.
joe
My next effort will be to implementing something to allow the Users to move
the buttons around on their screen.
Thanks for your help.
"Joseph M. Newcomer" wrote:
> .
>