CColorDialog #2

I am trying to work with the CColorDialog in an MFC app and everything is 
going fine, except I would like to change the title of the dialog so that 
instead of "Color" I make it say what I want it to say.  Seemed easy enough 
to do, but no.  Not much info on the web unless I am searching for the wrong 
kinds of info.

Of course, it derives from CWnd, so I tried SetWindowText(), but that failed 
and I assume it is because the handle to the color dialog doesnt exist until 
you call DoModal().  Thus the call to setting the window text fails because 
there is no window.

So, what are the possibilities here?  I'm working with VS 2005 on XP.  I 
hope I have given enough info to help.

thanks 


0
patriot92 (19)
2/21/2008 7:46:37 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
902 Views

Similar Articles

[PageSpeed] 39

Ah.  Solved the problem and now realize how silly it was not to see this.

I created a CCustomColorDialog derived from CColorDialog and overrode the 
OnInitDialog Function.

Also added a CString member to hold the title and a SetTitle(LPCTSTR) 
function to set the dialog title

I suppose I could append the string to the constructor as a fourth 
parameter.

so, there is the solution.


"asellon" <patriot92@cox.net> wrote in message 
news:Dykvj.14797$497.955@newsfe14.phx...
>I am trying to work with the CColorDialog in an MFC app and everything is 
>going fine, except I would like to change the title of the dialog so that 
>instead of "Color" I make it say what I want it to say.  Seemed easy enough 
>to do, but no.  Not much info on the web unless I am searching for the 
>wrong kinds of info.
>
> Of course, it derives from CWnd, so I tried SetWindowText(), but that 
> failed and I assume it is because the handle to the color dialog doesnt 
> exist until you call DoModal().  Thus the call to setting the window text 
> fails because there is no window.
>
> So, what are the possibilities here?  I'm working with VS 2005 on XP.  I 
> hope I have given enough info to help.
>
> thanks
> 


0
patriot92 (19)
2/21/2008 8:04:54 PM
It is pretty easy:
Create a new class that inherits form CColorDialog (you can do this by 
selecting Project->Add Class->MFC Class)
Then overwrite OnInitDialog. After the call to CColorDialog::OnInitDialog 
use SetWindowText to set the title.
Now use this new color dialog class instead of CColorDialog.


AliR.


"asellon" <patriot92@cox.net> wrote in message 
news:Dykvj.14797$497.955@newsfe14.phx...
>I am trying to work with the CColorDialog in an MFC app and everything is 
>going fine, except I would like to change the title of the dialog so that 
>instead of "Color" I make it say what I want it to say.  Seemed easy enough 
>to do, but no.  Not much info on the web unless I am searching for the 
>wrong kinds of info.
>
> Of course, it derives from CWnd, so I tried SetWindowText(), but that 
> failed and I assume it is because the handle to the color dialog doesnt 
> exist until you call DoModal().  Thus the call to setting the window text 
> fails because there is no window.
>
> So, what are the possibilities here?  I'm working with VS 2005 on XP.  I 
> hope I have given enough info to help.
>
> thanks
> 


0
AliR3470 (3236)
2/21/2008 8:07:42 PM
Reply:

Similar Artilces:

Name change #2
It has been so long that I forgot! I have an AD user with an Exchange 2000 mailbox who got married. What is the easiest way to change her email name to the new one but to retain all of her messages that are under the old name? Thanks! Just rename it and change the spelling of the email address. It is all done in the User Account Settings in ADUC. The names are for "human consumption",...the system identifies the User by the SID which does not change, so renaming effects nothing. -- Phillip Windell [MCP, MVP, CCNA] www.wandtv.com -----------------------------------------------...

range lookup #2
Would anyone know how to create a formula that would locate the max $ amount for each year? See below 10/5/01 $10.03 8/14/00 $9.79 8/14/00 $9.50 5/22/00 $8.85 2/28/00 $8.36 12/20/99 $8.36 8/19/99 $8.05 8/17/98 $7.78 7/20/98 $7.92 3/9/98 $7.55 --- Message posted from http://www.ExcelForum.com/ With the dates in A1:A10 formatted as text, one way is to array enter (i.e., enter with Ctrl+Shift+Enter instead of just Enter) =MAX((RIGHT(A$1:A$10,2)="00")*(B$1:B$10)) for the year 2000 Alan Beban tamsky < wrote: > Would anyone know ho...

Performing Division #2
Got it. Thanks a lot -- JohnnyCa ----------------------------------------------------------------------- JohnnyCat's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1658 View this thread: http://www.excelforum.com/showthread.php?threadid=31446 See Johnnycat got it. -- Don Guillett SalesAid Software donaldb@281.com "JohnnyCat" <JohnnyCat.1fvqrc@excelforum-nospam.com> wrote in message news:JohnnyCat.1fvqrc@excelforum-nospam.com... > > Got it. Thanks a lot! > > > -- > JohnnyCat > --------------------------------------------...

replicating birthdays from contacts to calendar #2
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Is there any way to replicate all birthdays stored in all Entourage contacts to my Entourage calendar? On 11/3/09 8:15 PM, in article 59b7fe9c.-1@webcrossing.caR9absDaxw, "Jim_Roche@officeformac.com" <Jim_Roche@officeformac.com> wrote: > Is there any way to replicate all birthdays stored in all Entourage contacts > to my Entourage calendar? Open the contact in the Address Book. Click on the Personal tab. There is an icon next to the birthday field. Click on it and select to add to Calendar. ...

compare 2 columns
Hi all, Can some one help me for my following question? I have some data in column A, and some in column C. For example, Column A 1 2 3 4 5 6 7 8 9 10 Column C 2 4 5 6 7 Now, I want to compare A2:A11 against C2:C6. Here is the question: If a number in column A do not exist in column C, enter that in Column B; otherwise if column A number exist in column C, do nothing or leave it blank. Like 1,3,8,9,10 do not exist in column C, so they should appear in column B. Thank you for your help. sndesai74@gmail.com wrote: > Hi all, > > Can some one help me for my following question...

.jpg attachment difficulties #2
User is running OL2002 on XP Pro. When attempt to open .jpg attachments, get error "Specified file cannot be found". Other attachments open fine. Can save .jpg attachment to disk then open no problem. Is there a setting I've missed? Anyone have a solution for me?Thanks. ...

Outlook 2000 quits #2
Microsoft Outlook 2000 quits when I try to recover deleted items from the recover deleted items command under tools. It only happens on a few PC. The other PC one fine ...

BP 2.5 and windows installer
has anyone encountered problem where the BP installer conks out at the Business Portal Configuration Screen? A windows installer message appears saying "Windows Installer encountered a problem and needs to close" That's the only message it gives and BP won't install properly anymore. Any help would be most appreciated.Thanks! ...

Public Folder replication issues #2
Hello All We just installed a new Exchange server, to replace our existing one (they are both 2003), and have completed the replication on the public folders. All of the public folders on our old server where mail enabled, and where working fine. Once we dismounted the original mail servers public store, the public folders on the new server would not receive any email. Does anyone have any suggestions on what could be causing this? Thanks Are you getting any NDRs or is there anything in the event logs? Nue "Exchange 2003" <Exchange2003@discussions.microsoft.com> wro...

Hidden Column
Hi Can anyone Help I have a spreadsheet, and on my 3rd worksheet, the first column (A) was hidden, now I want to show that column, but it just isnt appearing. I have tried, Format > Column > unhide as well as Row > Unhide, Ive also tried Edit > Go To > A1 and it still doesnt appear. Any thoughts? x ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements Preet w...

Upgrading CRM1.2 to CRM3.0 schema problem
Hi All, Recently, I am doing a test on upgrading CRM1.2 to CRM3.0 for my company. I am using a replicate from production server to do the testing. However, I encounter an error during the upgrade. The error message goes like this: Badly Formed FieldXml: Field name CFSPassword Does not correspond to any Attribute on Entity: contact. Field Xml = <field name="CFSPassword" requiredlevel="na" maxlength="50" format="text"><displaynames><displayname description="Password" languagecode="1033" /></displaynames>...

E-Mail #2
When I E-mail A Excel Document 1 Page The Recipient Receives It As A Very Large Page Like It's Been Blown Up, How Can I Reduce The Size And Correct This Problem? Hi joe Your usedrange is to big http://www.contextures.com/xlfaqApp.html#Unused -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Joe" <anonymous@discussions.microsoft.com> wrote in message news:392001c3e298$8edb9f10$a401280a@phx.gbl... > When I E-mail A Excel Document 1 Page The Recipient > Receives It As A Very Large Page Like It's Been Blown Up, > How Can I Reduce T...

Visual Basic Editor #2
After installing M.S. Office 2003, I tried to run an excel spredsheet application the VB editor try's unsuccessfully to install. ...

Custom Form Question #2
I have created two almost identical custom forms for Outlook 2007 in an exchange environment. The forms are based on the task form, and simply have a second tab that we each sign off on the steps of our projects as they go. We create those forms by going to action|new "custom" form. However, one of the forms appears as a task with a task icon in the task folder when I create it. But, the other shows up in the task folder, but with a post item icon, that is the little yellow sticky note with the blue push pin in it. I can't find where you set this attribute and why one form i...

Getting Cashier ID as 0 #2
I am getting cashier Id as 0 everytime ?? I am trying to display the Cashier Id on message box and everytime its displaying 0 Following is the code that I have used... It always goes to Else condition and displays 0.... Hook Type was 2 i.e TenderBegin Public Function Process(Optional mySession As Object) As Boolean Set mySession = CreateObject("QSRules.SessionClass") If mySession.Cashier.ID = 1 Then MsgBox (mySession.Cashier.FirstName) Else MsgBox ("Id is not know" & mySession.Cashier.ID) End If End Function Please He...

Display related entities in IFRAME #2
Hi everyone, can anyone help me please, I have a custom entity -Projects that has a N:1 relationship with Accounts, I added an IFRAME on the account entity and wrote a script on the Onload event(Account). I have checked the ID and tabset on the view source but cannot get it right, I get an error. Please check my code below. var nav_new_accounts_new_projects, nav_new_accounts_new_projects = document.all.nav_new_accounts_new_projects; if (nav_new_accounts_new_projects !=null) {nav_new_accounts_new_projects.style.display = "none"; document.all.IFRAME_Projects.src="/sfa/acct...

Opening other user's folder #2
I have set up outlook to open other user's folders. There are some people who have left the dept. and I'd like to remove them from the Other User's Folder pull down menu. I've removed full mailbox access using ADUC, but want to remove the "other user's" name from the display without creating new outlook profile. Any solutions to this? Registry setting? thx See http://www.slipstick.com/outlook/usertips.htm#otherusers for information on what changes to make in the registry to clear the "open other user's folder" history. -- Sue Mosher, ...

host hospedam profissional por 2,99 ao =?ISO-8859-1?Q?m=EAs?=
Tudo sobre hospedagem de sites , planos profissionais , economicos e muitos outros , sua empresa na internet por apenas 2,99 ao m�s! http://hostbrasil.rg3.net ...

Exchange Routing #2
Hi There, I am running EX2K3 with SP2, with 3 bridgehead servers, in Sydney, Manchester, and Melbourne. My Exchange servers that are located in the UK, use 3 RGC's with 3 different costings in the following order Manchester bridgehead (20), Sydney Bridgehead(30), Melbourne Bridgehead (40). For some reason my Exchange server continues to use my Sydney bridgehead server through the second RGC, and not my default Manchester RGC which has a lower cost. However, if I delete the Sydney RGC it works via Manchester, or if I make Sydney RGC more expensive than Melbourne RGC it will also use...

VlookUp error #2
Hi Pete Kindly gave me a formulae to check 2 seperate columns for a value: =IF(ISNA(MATCH(A2&"",Gazatteer!A$2:B$65001,0)),IF(ISNA(MATCH (A2&"",Gazatteer!$G3:H$65001, 0)),"not found",VLOOKUP(A2&"",Gazatteer! $G2:H$65001,1,0)),VLOOKUP(A2&"", Gazatteer!A$2:D$65001,1,0)) I get not found. When I use 2 seperate Vlookup, the one works (the data is in either A2:C65000 or G2:F65000) The following works: =VLOOKUP( A2, Gazatteer!A$2:C$65536, 1, 0 ) (A) =VLOOKUP( A2, Gazatteer!F$2:G$65536, 1, 0 ) (B) This requires 2 coloumns, rather...

Comparing Data in 2 Tables
I need to create a query that compares data in 2 tables. If the data exists in one table but not in the other, the query should take those exceptions and put them in a new table. Any ideas how this should look? Start with creating an unmatch record query, using the query wizard, that will return the record that exist in one table but not in the other. After you achieve that, change the query from select query to append query to append the record to the third table. But remember that to display the extra records yo can use the above select query, you don't have to append the recor...

econnect sdk #2
I installed econnect runtime. I installed econnect sdk. But in the install wizard I just installed the documentation; was I supposed to install the incoming/outgoing component as well as the other choice? Were these installed when I installed the runtime? Do they offer any new functionality or it only the documentation that is I would benefit from? Thanks for any information. When you installed the eConnect SDK, it should have installed the .CHM file, the runtime, and the Requester Configuration tool. You can check by going to Start > All Programs > Microsoft Dynamics > eConn...

CountIf on 2 columns
I have 2 columns of data, Profit $ and Profit %. I would like to get a grouping of different counts. For example, the number of items with Profit $ > 500 and Profit % > .50, down to the items with Profit $ <5 and Profit % < .10 and various groups in between. I can get the data for one column using COUNTIF but how do I do it for 2 columns? TIA, JC =SUMPRODUCT(--(ProfitDollarRange>X2),--(ProfitPercentageRange>Y2) X2 houses a dollar value like 500 and Y a percentage value like 0.50. "JC" <anonymous@discussions.microsoft.com> wrote in message news:0df4...

Trouble installing Office 2004 Service Pack 2
Like a previous poster, I am getting the message "Installer could not locate the correct version of the software required to install this update." I have tried a standalone download, Auto Update, and removing and reinstalling Office (more than a five-minute procedure) followed by the updating wizard, all with the same non-result. I installed only Word, Excel, and PowerPoint. For the record, I use OS 10.4.2 with the most recent security patch, and until I reinstalled had Office 2004 up to date as well. Any suggestions about where to go from here would be welcome. In article <112...

2.0
One annoying problem in 1.3 was having to print a workorder to reset the default printer after viewing a transaction from POS lane with different printer. I thought 2.0 was supposed to fix this problem? ...