OnCtlColorDlg & return NULL

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

0
rmdiv2000 (14)
2/16/2005 6:47:03 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
835 Views

Similar Articles

[PageSpeed] 5

This is a multi-part message in MIME format.

------=_NextPart_000_0253_01C5143E.6CAEA580
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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@yahoo.com> wrote in message =
news:1108579623.542894.256430@l41g2000cwc.googlegroups.com...
> The MS documentation about WM_CTLCOLORDLG says:
>=20
> "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."
>=20
> The documentation about "CWnd::OnCtlColor" says something quite
> similar. But then when the wizzard generates OnCtlColor the included
> comment says:
>=20
> "TODO: Return a different brush if the default is not desired".
>=20
> Now I wonder if really a brush MUST(!) be returned. Returning NULL
> works. Nevertheless, that doesn't mean it's valid to do so.
>=20
> 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.
>=20
> Thanks,
> Rob
> 
------=_NextPart_000_0253_01C5143E.6CAEA580
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1491" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>If your read a little further down =
about=20
WM_CTLCOLORDLG it also says:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<P><FONT face=3DArial size=3D2>"If a dialog box procedure handles this =
message, it=20
should cast the desired return value to an INT_PTR and return the value=20
directly. <STRONG>If the dialog box procedure returns FALSE, then =
default=20
message handling is performed</STRONG>."</FONT></P>
<P><FONT face=3DArial size=3D2></FONT>&nbsp;</P></DIV>
<DIV><FONT face=3DArial size=3D2>"rob" &lt;</FONT><A=20
href=3D"mailto:rmdiv2000@yahoo.com"><FONT face=3DArial=20
size=3D2>rmdiv2000@yahoo.com</FONT></A><FONT face=3DArial size=3D2>&gt; =
wrote in=20
message </FONT><A=20
href=3D"news:1108579623.542894.256430@l41g2000cwc.googlegroups.com"><FONT=
=20
face=3DArial=20
size=3D2>news:1108579623.542894.256430@l41g2000cwc.googlegroups.com</FONT=
></A><FONT=20
face=3DArial size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; =
The MS=20
documentation about WM_CTLCOLORDLG says:<BR>&gt; <BR>&gt; "If an =
application=20
processes this message, it must return the handle of<BR>&gt; a brush. =
The system=20
uses the brush to paint the background of the<BR>&gt; dialog =
box."<BR>&gt;=20
<BR>&gt; The documentation about "CWnd::OnCtlColor" says something =
quite<BR>&gt;=20
similar. But then when the wizzard generates OnCtlColor the =
included<BR>&gt;=20
comment says:<BR>&gt; <BR>&gt; "TODO: Return a different brush if the =
default is=20
not desired".<BR>&gt; <BR>&gt; Now I wonder if really a brush MUST(!) be =

returned. Returning NULL<BR>&gt; works. Nevertheless, that doesn't mean =
it's=20
valid to do so.<BR>&gt; <BR>&gt; Finally, if I can return NULL for =
WM_CTLCOLOR=20
can I also return NULL<BR>&gt; for WM_CTLCOLORDLG? I would assume so but =
again=20
the documentation isn't<BR>&gt; really clear on that.<BR>&gt; <BR>&gt;=20
Thanks,<BR>&gt; Rob<BR>&gt; </FONT></BODY></HTML>

------=_NextPart_000_0253_01C5143E.6CAEA580--

0
AliR1 (391)
2/16/2005 9:44:39 PM
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

0
rmdiv2000 (14)
2/16/2005 10:20:10 PM
Reply:

Similar Artilces:

Lookup Values, return multiple.
I need help please. The formula I require has to in Worksheet A :- [B1] lookup DATA in Worksheet A [A1] SP001 in worksheet B [A] [B] [C] SP001 PL001 16 SP001 PL002 5 SP001 DR001 10 CR001 PL001 2 Search for all Text String starting with "PL" in Worksheet B [B] only for SP001 in [A] and return with values from Worksheet B [C] 16 and 5 I need the values to be seperated and not summed. Tx. Appreciate assistance. Try this... In the formulas: Rng1 refers to worksheet B $A$2:$A$5 Rng2 refers ...

% Return Line graph?
Hi- Can someone show me how to customize a graph in Money 2005 to show my stock portfolio's % change over time? I just want a simple line chart showing my percentage change since the beginning - as a way to just figure out relative performance but I can't seem to find the right graph to customize. I can't just chart the value of the portfolio as I have been adding money to it over time which has drastically changed the % returns. I am not sure if what I want is possible or if this is clear but I also have the plugin for MS Excel that I can import money data so if there is...

kit item return
There should be an option in the Store Op Manager --> Configuration --> Option Tab to allow the ability when returning a Kit Item to either return the quantity back to the Kit Items Inventory or to the Kit Item COMPONENTS Inventory. Effectively breaking out the Kit Item automatically when the item is returned to inventory. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to op...

Formula that returns the sheetname
Does anyone know of a formula that would return the active sheetname? http://www.mcgimpsey.com/excel/formulae/cell_function.html "TimT" wrote: > Does anyone know of a formula that would return the active sheetname? Great Link! The formula was =MID(CELL("filename",A1), FIND("]", CELL("filename", A1))+ 1, 255) ....yeah, like I was gonna figure that one out on my own. "David Hepner" wrote: > http://www.mcgimpsey.com/excel/formulae/cell_function.html > > > "TimT" wrote: > > > Does anyone know of a form...

Function to Return the IP Address of a known Host
Hi People, This function returns the IP Address of a known host. I hope you find it useful. Function xlGetIPAddress(strHost As String) 'Ping a host to see if it is alive Dim objPing Dim objRetStatus Dim strMessage If strHost = "" Then xlGetIPAddress = False Else Set objPing = GetObject("winmgmts: {impersonationLevel=impersonate}").ExecQuery("select * from Win32_PingStatus where address = '" & strHost & "'") For Each objRetStatus In objPing If IsNull(objRetStatus.StatusCode) Or objRet...

Nulls in SP
I have a stored procedure (see below) that I need to make the last 2 parameters optional and place a NULL value when they are not sent. Can someone help show me how this is done? Thanks. David ALTER PROCEDURE [dbo].[mc_insHistoryDates] @PeopleLinkID int, @HistoryTypeID int, @HistoryReasonID int, @HistoryDate date, @HistoryDateTo date, @HistoryText varchar(1000) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; INSERT INTO [MCFICore].[dbo].[HistoryDates] ([PeopleLinkID] ...

If it returns #N/A, making it return 0
I have a list of numbers, that at the end of their row it averages them. However, the numbers are obtained by a VLOOKUP function. If it can't find what it's looking for, it returns #N/A which makes it so it can't calculate the average at the end. Is there any way to get the VLOOKUP function to return 0 instead of #N/A? Or maybe make the cell return 0 if the VLOOKUP function returns #N/A? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ Also, if it return...

error message messaging inerface has returned an unknown error
how do i remove the error message "messaging interface has t=returned an unknown error" from oganinze window. restatring outlook does not help. ...

Lookup returns text?
Is there a function similar to SUMIF for numerical data that will retur text? I have a list of item #'s that have no description. I want to be abl to lookup the item # and return the description from a master list. Any ideas? TEXTIF would be great, but that doesn't exist that I'm aware of. Thanks, Rya -- Message posted from http://www.ExcelForum.com Ryan Check out the Help for VLOOKUP Regards Trevor "rydolarue >" <<rydolarue.1b8xeb@excelforum-nospam.com> wrote in message news:rydolarue.1b8xeb@excelforum-nospam.com... > Is there a function simil...

a function which accepts a number and returns it in words
In Excel is there a function which accepts a number and returns it in words, eg myFunction(15) return "fifteen" http://xldynamic.com/source/xld.xlFAQ0004.html -- Kind regards, Niek Otten Microsoft MVP - Excel "aa" <A@aa.com> wrote in message news:ulnsf%23xXHHA.4220@TK2MSFTNGP03.phx.gbl... | In Excel is there a function which accepts a number and returns it in words, | eg myFunction(15) return "fifteen" | | Bob Phillips' site for help on this. http://www.xldynamic.com/source/xld.xlFAQ0004.html or Bernd Plumhoff's site http://www.s...

Hide Sub Report(s) when records are null
I am running Access 2007 sp2 MSO. I have a report that has three (3) sub reports. There are times when not all three sub reports have values to display. Is there a way to code the given report to not be visible if there are no records to report? The second part of this question would be if there is a way to make the report invisible is it also possible to code so that the space where the report would normally reside would not be taken with a blank space (the foot print of where the report normally resides)? -- Bruce ...

Please help
I have a query that returns text. SOME text is just text but some text has a number like X1027 - in front of the text. It might read like "X1027 - Jonesboro High School". The text lengths vary from school to school and some don't have the numbers in front. How can I remove the numbers, spaces, and - in front of the ones that do and leave alone the ones that don't. Help!!! Thanks so much!!!!!! "Golfinray" <Golfinray@discussions.microsoft.com> wrote in message news:93B7A4A5-7287-409C-AA89-200820C8DF5A@microsoft.com... >I have a query that returns text....

Return
I bought "Essentials" but later found that my previous version of Money does not import. I would like to upgrade to "Delux" so that I can use my previous data. I bought the program and downloaded it a few days ago and an now trying to return it but to no avail. The help page states that there is a "Request a Return" tab but there is no such button only a "view inoice" tab. Where can I upgrade or return the "Essentials"? In microsoft.public.money, Bryan wrote: >I bought "Essentials" but later found that my previous versio...

Total Return YTD #2
Question AT 3pm today my total return ytd was 3.9%. I entered a CD i purchased today and total return YTD went down to 3.5% with no material change in anything else in my portfolio. In my opinion this would render the total return useless. Am I missing something? Thanks in advance for any help ...

get the curser to automatically return
How do I get the curser to automatically return to my starting column (example I’m in A1 and move to C1 enter and the curser will not go back to A2 only up, down, left, right ). Is there a way to set this up so it will return to your starting point? Charles -- Charles Charles Start in A1 then TAB across to C1. When leaving C1 hit ENTER key to drop down to A2. Using this method you will always return to original column and down one row. Another method is to unprotect columns A to C then protect the worksheet. TAB will move you across to C then back to A down one row. Gord Dibben E...

Returns with discounts
HI, I am Having a problem with RMS POS. I have a quantity discount for items purchase in quantity of 5 or more. But when i do a return with a negative quantity, the discounted price does apply. For example, item a is priced at $6.95 each or 5 for $29.95 ($5.99 ea). If the customer returns some or all 5 of those item, POS stick with the single item price ($6.95). I tried entering negative quantities in the discounted pricing level option under the discounts tabs but that doesn't seem to work. Is there a way to get this quantity discounts to work with returns as well? Are you re...

only returning cells with Text in it
Hi, I have a column that returns some text, if something else is true. Now what I want to do is take only the cells in that column and list them on another sheet. The trick is, that ill need to do this with a frmula, since it will be a hosted template and the user wont be able to use excel functions like sort, etc. so, if I have 10 cells and 3 of them have test in them, I want to show only the text in those 3 cells in another sheet. I hope that makes sense.... Thanks for your help.... Assuming that Sheet1!A1:A10 contains your data, enter the following formula in Sheet2!A1 and copy do...

return min. of range except 0
What formula should I use to return the minimum no. in a range of numbers, except 0? e.g. 1, 4, 7, 0, 6, 8 The min should be 1 and not 0. One way: =SMALL(A1:A6,IF(MIN(A1:A6)=0,2,1)) -- Jim "Melissa" <Melissa@discussions.microsoft.com> wrote in message news:87692A0B-60A3-4C44-9258-CA461C160B23@microsoft.com... | What formula should I use to return the minimum no. in a range of numbers, | except 0? | e.g. 1, 4, 7, 0, 6, 8 | The min should be 1 and not 0. =min(if(a1:a10<>0,a1:a10)) or if there's a chance you won't have any non-zero numbers: =IF(COUNT(A1:A10...

OnCtlColorDlg & return NULL
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 re...

uninstall office outlook and return to previous version
I'm sure you've heard this before. Please Help.... I went from Outlook 5.0 to office 2000 outlook and want to go back. How do I do this? All help is thanked There is no "Outlook 5.0" -- you must have been using Outlook Express 5.0 before. Outlook and Outlook Express are actually two completely different programs despite the annoyingly similar name. What exactly are you hoping to do -- do you really need to uninstall Office 2000? If so, you can do that from Control Panel | Add/Remove Programs; make sure you have the Office 2000 disc handy in case it's needed. If a...

Customer Returns
I'd like to know if there someone has written a RMS report that shows the customer account number, customer's name (last, first), and other customer statistics that INCLUDE pieces purchased and pieces returned. Or, if someone with more knowledge of SQL would care to share their coding expertise to accomplish the same, it would be appreciated. ...

Return-Path: <> from Postmater
Hi, I got Exchange 2003 SP1 on Windows 2003 in Native Mode and when I receive bad mail the response is made from postmaster@mydomain.com but the return-path field is blank. With some anti-spam filter this Email is Junk. Return-Path: <> Anybody know how to specifeid a return-path to the NDR mail? _____________ Thank you Sebastien On Fri, 4 Nov 2005 12:48:04 -0800, "Sebas" <Sebas@discussions.microsoft.com> wrote: >Hi, > >I got Exchange 2003 SP1 on Windows 2003 in Native Mode and when I receive >bad mail the response is made from postmaster@mydomain.c...

Query regarding A,B,C char. width values returned in 16-bit and 32-bit OS
I am trying to retrieve individual character widths of a string (from a TrueType font) and I tried using GetCharWidth (which weirdly works for TrueType fonts too tho' MSDN says otherwise) and/or GetCharABCWidths to retrieve the A,B and C spacings. Please note that I have selected the TrueType font (hFont) into the Device Context (hDC). I used GetCharABCWidths. Problem is this: GetCharABCWidths returns correct A,B and C widths in Win 98 and incorrect (much lesser A,B and C widths such that the characters OVERLAP) in other 32-bit OS (NT, XP). The effect is seen across all TrueType fonts, th...

Report for Returns
Anyone know a why to report on frequency of customer returns -- so we can see if any customers are making habit of this? Thanks and regards, Rich hitman, Try running a detailed sales report filtered to only negative sales displayed. Good luck, Matt "hitman" <hitman@discussions.microsoft.com> wrote in message news:0B3EE780-2655-45B4-B3C6-1F5D35FFA2A7@microsoft.com... > Anyone know a why to report on frequency of customer returns -- so we can > see > if any customers are making habit of this? > > Thanks and regards, > > Rich ...

Site for SOP Returns
Is it possible to have a different default Site ID for Returns than Standard Orders? Yes. You must make sure to change the site when performing a Return Transaction. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com "Everton Raymond" wrote: > Is it possible to have a different default Site ID for Returns than Standard > Orders? Sorry, I did not see the word "default" in your post until after I r...