From: rob on
The MS documentation about WM_CTLCOLORDLG says:

"If an application processes this message, it must return the handle of
a brush. The system uses the brush to paint the background of the
dialog box."

The documentation about "CWnd::OnCtlColor" says something quite
similar. But then when the wizzard generates OnCtlColor the included
comment says:

"TODO: Return a different brush if the default is not desired".

Now I wonder if really a brush MUST(!) be returned. Returning NULL
works. Nevertheless, that doesn't mean it's valid to do so.

Finally, if I can return NULL for WM_CTLCOLOR can I also return NULL
for WM_CTLCOLORDLG? I would assume so but again the documentation isn't
really clear on that.

Thanks,
Rob

From: AliR on
If your read a little further down about WM_CTLCOLORDLG it also says:

"If a dialog box procedure handles this message, it should cast the desired return value to an INT_PTR and return the value directly. If the dialog box procedure returns FALSE, then default message handling is performed."



"rob" <rmdiv2000(a)yahoo.com> wrote in message news:1108579623.542894.256430(a)l41g2000cwc.googlegroups.com...
> The MS documentation about WM_CTLCOLORDLG says:
>
> "If an application processes this message, it must return the handle of
> a brush. The system uses the brush to paint the background of the
> dialog box."
>
> The documentation about "CWnd::OnCtlColor" says something quite
> similar. But then when the wizzard generates OnCtlColor the included
> comment says:
>
> "TODO: Return a different brush if the default is not desired".
>
> Now I wonder if really a brush MUST(!) be returned. Returning NULL
> works. Nevertheless, that doesn't mean it's valid to do so.
>
> Finally, if I can return NULL for WM_CTLCOLOR can I also return NULL
> for WM_CTLCOLORDLG? I would assume so but again the documentation isn't
> really clear on that.
>
> Thanks,
> Rob
>
From: rob on
Thanks for pointing that out to me. Actually, I was reading the
description for "CWnd::OnCtlColor" where nothing like that was
mentioned. Then I checked WM_CTLCOLORDLG and also so a similar sentence
which I ended up quoting. Anyway, I think that pretty much answers my
question.

Rob

 | 
Pages: 1
Prev: Treeview
Next: Stopping a Thread