XP Style button using MFC 4.2

Hi,

I am using Visual C++ 6, MFC 4.2. Windows XP SP2.

My problem is, how could I get the XP Style buttons on the dialog. If i 
dynamically create the button using CreateWindow() the button still looks 
same.

I've tried 'Button Controls' article on MSDN but no luck.

Could anyone help me?

Thanks,
Fahad
0
4/8/2005 8:17:04 PM
vc.mfc 33608 articles. 0 followers. Follow

8 Replies
709 Views

Similar Articles

[PageSpeed] 1

Themes are handled by the system, and not on a button-basis.

The way to give your application running on XP the themed look is to include
a manifest resource. The resource can either be a resource compiled into
your EXE or it can be a separate file in the same directory as your EXE.

Visual Studio will generate manifest resources automatically, however, it is
worth noting that they are not included unless your application is built for
Unicode. The reasons for this include a) there are some conflicts with
manifests and non-Unicode apps, and b) Microsoft wants everyone to upgrade
to XP and here's a chance for them to encourage us.

-- 
Jonathan Wood
SoftCircuits
http://www.softcircuits.com
Available for consulting: http://www.softcircuits.com/jwood/resume.htm

"Fahad Ashfaque" <FahadAshfaque@discussions.microsoft.com> wrote in message
news:E52DE8E0-2D0B-4E5D-9BF3-4C564D6B0BC4@microsoft.com...
> Hi,
>
> I am using Visual C++ 6, MFC 4.2. Windows XP SP2.
>
> My problem is, how could I get the XP Style buttons on the dialog. If i
> dynamically create the button using CreateWindow() the button still looks
> same.
>
> I've tried 'Button Controls' article on MSDN but no luck.
>
> Could anyone help me?
>
> Thanks,
> Fahad


0
jwood (1292)
4/8/2005 9:41:42 PM
Thanks for jwood's reply.
Can you give me a sample?My e-mail is liyejun**@gmail.com (Replace the **@
with @ to reply.)
Thanks.



> Themes are handled by the system, and not on a button-basis.
>
> The way to give your application running on XP the themed look is to
include
> a manifest resource. The resource can either be a resource compiled into
> your EXE or it can be a separate file in the same directory as your EXE.
>
> Visual Studio will generate manifest resources automatically, however, it
is
> worth noting that they are not included unless your application is built
for
> Unicode. The reasons for this include a) there are some conflicts with
> manifests and non-Unicode apps, and b) Microsoft wants everyone to upgrade
> to XP and here's a chance for them to encourage us.
>
> --
> Jonathan Wood
> SoftCircuits
> http://www.softcircuits.com



0
4/9/2005 2:25:38 AM
Hey Jonathan wood, send me the sample too, my email is 
fahadREMOVETHIS.ashfaq@softech.us 

Thanks

Fahad

"Jonathan Wood" wrote:

> Themes are handled by the system, and not on a button-basis.
> 
> The way to give your application running on XP the themed look is to include
> a manifest resource. The resource can either be a resource compiled into
> your EXE or it can be a separate file in the same directory as your EXE.
> 
> Visual Studio will generate manifest resources automatically, however, it is
> worth noting that they are not included unless your application is built for
> Unicode. The reasons for this include a) there are some conflicts with
> manifests and non-Unicode apps, and b) Microsoft wants everyone to upgrade
> to XP and here's a chance for them to encourage us.
> 
> -- 
> Jonathan Wood
> SoftCircuits
> http://www.softcircuits.com
> Available for consulting: http://www.softcircuits.com/jwood/resume.htm
> 
> "Fahad Ashfaque" <FahadAshfaque@discussions.microsoft.com> wrote in message
> news:E52DE8E0-2D0B-4E5D-9BF3-4C564D6B0BC4@microsoft.com...
> > Hi,
> >
> > I am using Visual C++ 6, MFC 4.2. Windows XP SP2.
> >
> > My problem is, how could I get the XP Style buttons on the dialog. If i
> > dynamically create the button using CreateWindow() the button still looks
> > same.
> >
> > I've tried 'Button Controls' article on MSDN but no luck.
> >
> > Could anyone help me?
> >
> > Thanks,
> > Fahad
> 
> 
> 
0
4/9/2005 6:35:02 AM
you will find this article intresting
http://www.developer.com/net/asp/article.php/3101831

--

With Regards
Alok Gupta
Visit me at http://alok.bizhat.com

                           "I Believe this will Help"
"Fahad Ashfaque" <FahadAshfaque@discussions.microsoft.com> wrote in message
news:E3644896-06F7-479F-9AA6-0453A2E538B7@microsoft.com...
> Hey Jonathan wood, send me the sample too, my email is
> fahadREMOVETHIS.ashfaq@softech.us
>
> Thanks
>
> Fahad
>
> "Jonathan Wood" wrote:
>
> > Themes are handled by the system, and not on a button-basis.
> >
> > The way to give your application running on XP the themed look is to
include
> > a manifest resource. The resource can either be a resource compiled into
> > your EXE or it can be a separate file in the same directory as your EXE.
> >
> > Visual Studio will generate manifest resources automatically, however,
it is
> > worth noting that they are not included unless your application is built
for
> > Unicode. The reasons for this include a) there are some conflicts with
> > manifests and non-Unicode apps, and b) Microsoft wants everyone to
upgrade
> > to XP and here's a chance for them to encourage us.
> >
> > --
> > Jonathan Wood
> > SoftCircuits
> > http://www.softcircuits.com
> > Available for consulting: http://www.softcircuits.com/jwood/resume.htm
> >
> > "Fahad Ashfaque" <FahadAshfaque@discussions.microsoft.com> wrote in
message
> > news:E52DE8E0-2D0B-4E5D-9BF3-4C564D6B0BC4@microsoft.com...
> > > Hi,
> > >
> > > I am using Visual C++ 6, MFC 4.2. Windows XP SP2.
> > >
> > > My problem is, how could I get the XP Style buttons on the dialog. If
i
> > > dynamically create the button using CreateWindow() the button still
looks
> > > same.
> > >
> > > I've tried 'Button Controls' article on MSDN but no luck.
> > >
> > > Could anyone help me?
> > >
> > > Thanks,
> > > Fahad
> >
> >
> >


0
thatsalok1 (226)
4/9/2005 7:23:10 AM
you will find this article intresting
http://www.developer.com/net/asp/article.php/3101831

--

With Regards
Alok Gupta
Visit me at http://alok.bizhat.com

                           "I Believe this will Help"
"Miken" <mikenwonder@msn.com> wrote in message
news:efcgmqKPFHA.3156@TK2MSFTNGP15.phx.gbl...
> Thanks for jwood's reply.
> Can you give me a sample?My e-mail is liyejun**@gmail.com (Replace the **@
> with @ to reply.)
> Thanks.
>
>
>
> > Themes are handled by the system, and not on a button-basis.
> >
> > The way to give your application running on XP the themed look is to
> include
> > a manifest resource. The resource can either be a resource compiled into
> > your EXE or it can be a separate file in the same directory as your EXE.
> >
> > Visual Studio will generate manifest resources automatically, however,
it
> is
> > worth noting that they are not included unless your application is built
> for
> > Unicode. The reasons for this include a) there are some conflicts with
> > manifests and non-Unicode apps, and b) Microsoft wants everyone to
upgrade
> > to XP and here's a chance for them to encourage us.
> >
> > --
> > Jonathan Wood
> > SoftCircuits
> > http://www.softcircuits.com
>
>
>


0
thatsalok1 (226)
4/9/2005 7:23:13 AM
I have read the URL
link:http://www.developer.com/net/asp/article.php/3101831
I find the author uses vs.net as his development tool,and NOT vc6.0.
At the first step,I cann't set the FlatStyle property of the controls to
System.
Please help me,and thanks.


--



Regards,
Miken
_____________________________________________________
http://www.msale.net/bbs/
a Chinese-language message board for developers,including
palm,ppc,symbian,and etc.

http://www.zirong.net/blog/
my private life

E_mail:liyejun**@gmail.com (Replace the **@
with @ to reply.)


0
4/9/2005 9:29:19 AM
Follow thats method in Vc 6.0,   I too  working in VC 6.0 and following same
steps except making control FLAT.

if you like i can post a sample app (in MFC) for that!

--

With Regards
Alok Gupta
Visit me at http://alok.bizhat.com

                           "I Believe this will Help"

"Miken" <mikenwonder@msn.com> wrote in message
news:eiP2HbOPFHA.1528@TK2MSFTNGP09.phx.gbl...
> I have read the URL
> link:http://www.developer.com/net/asp/article.php/3101831
> I find the author uses vs.net as his development tool,and NOT vc6.0.
> At the first step,I cann't set the FlatStyle property of the controls to
> System.
> Please help me,and thanks.
>
>
> --
>
>
>
> Regards,
> Miken
> _____________________________________________________
> http://www.msale.net/bbs/
> a Chinese-language message board for developers,including
> palm,ppc,symbian,and etc.
>
> http://www.zirong.net/blog/
> my private life
>
> E_mail:liyejun**@gmail.com (Replace the **@
> with @ to reply.)
>
>


0
thatsalok1 (226)
4/9/2005 10:37:14 AM
>if you like i can post a sample app (in MFC) for that!

My e-mail is liyejun**@gmail.com (Replace the **@ with @ to reply.)
Thanks.




Regards,
Miken
_____________________________________________________
http://www.msale.net/bbs/
a Chinese-language message board for developers,including
palm,ppc,symbian,and etc.

http://spaces.msn.com/members/liyejun/
my private life

E_mail:liyejun**@gmail.com (Replace the **@
with @ to reply.)


0
4/9/2005 3:25:19 PM
Reply:

Similar Artilces:

Using part of a cell in a chart title
I have a chart which should get a title. However, this should be partly be used from a cell e.g. "counted with 5%" 5% should be taken from the cell and used in the title. Is this possible? Hi, Yes it's possible but all of the chart title needs to be in the cell. So you may need to use a helper cell and concatenate text and value. http://www.andypope.info/tips/tip001.htm Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Nicole" <Nicole@discussions.microsoft.com> wrote in message news:5CB7A971-AA7F-4C34-BB42-7DC283AA2958@micro...

Transferring over outlook data to new XP machine
How do I transfer over my old emails, address book to my new XP machine? I have looked over the internet and found nothing the tells me EXACTLY how to do this, any help would be greatly appreciated. senior_tech@yahoo.com If your using MS Outlook copy your .PST file across and import it into the new install. >If your using MS Outlook copy your .PST file across and import it into the new install. No, don't import it. Simply use "File">"Open" -- Brian Tillman Smiths Aerospace 3290 Patterson Ave. SE, MS 1B3 Grand Rapids, MI 49512-1991 Brian.Tillman is the nam...

SMTP Connectors #4
Hi, I have a problem with two Front-End servers in NLB. I have two connectors with address space *, one connector with cost 10 the other with cost 20 for connector availability purposes. Inbound mails are targeted to FrontEnd1, outbound mails should go from FrontEnd2 (e.g. MX for FrontEnd1 cost is 10; MX cost for FrontEnd2 is 20) Connectors: FrontEnd1 - Address space * - cost 10 - bridgehead srv = FrontEnd1; FrontEnd2 - Address space * - cost 20 - bridgehead srv = FrontEnd2 The problem: If both servers are up and running and somehow some mail ends in queue on FrontEnd2 it correctly crea...

Lookup based on criteria in 2 columns
Hi, I am trying to use a vlookup or other function to return the value in the amount column based on the location and date. Here is a sample of my data: Location Date Amount 101 9/15/8 10 101 9/16/8 20 101 9/17/8 15 102 9/15/8 50 102 9/16/8 75 102 9/17/8 67 For example if I wanted to return the amount for location 102 on 9/15/8, what formula would I use? I tried using variations of vlookups but had no luck. Thanks, =SUMPRODUCT(--(A2:A50=102),--(B2:B50=DATE(2008,9,15)),C2:C50) -- Regards, Peo Sjo...

Customized Toolbar RestoreState() fails if it has only 1 button
This issue happens only when the numbers of buttons in the tool bar is "1". Thats is, the user launches the customize toolbar dialog and removes all but 1 tool bar button. I have multiple Tool bars which I persist on application close and restore on application load. The SaveState() works fine as I notice the value "55 81 00 00" saved if only 1 button is left in the Tool bar. Here is the code for the RestoreState for (int i = 0; i < m_ToolBars.GetSize(); i++) { HKEY hSecKey = AfxGetApp()->GetSectionKey("Tool Bars"); if (hSecKey == NULL) break; CS...

Standard MFC controls behave different when showing polish characters
Hello all, I have a rather simple to describe but difficult to solve problem. Our customers want to use our ANSI MFC program to show different languages. For example Polish. When I set the font for the different controls they behave different. For example the CEdit shows the polish characters just right but the CButton with checkbox style shows glyphs instead of the special characters. Every control that is owner draw and uses for example the DrawText() function of the device context shows the characters right. I've experimented with _UNICODE for the display part and everything I could ...

Using expression builder object
Hi, I'm developing a wizzard in Access which builds import templates for various data sources to a fixed set of tables. In step 3 the users must be able to build an expression ; for instance Left([Fieldx],20) . Now I would like to have a command button on my form which calls the Access expression builder to allow the users to use this to build the expression. This expression will then be stored in a text box linked to the templates table. Anybody know how to call and use this object from VBA code? -- Kind regards Noëlla DoCmd.RunCommand acCmdInvokeBuilder I th...

Rollup 2 and Office 2007
I already have Roll Up 1 and the Office 2007 compatibility patch installed. If I now install roll up 2 will I have to reinstall the office 2007 compatibility? yes -- Regards, MS CRM Certified Professional http://microsoftcrm3.blogspot.com Chat with me on MSN / Gmail / Skype : ID Is :.. mscrmexpert@gmail.com "LLoyd" wrote: > I already have Roll Up 1 and the Office 2007 compatibility patch installed. > If I now install roll up 2 will I have to reinstall the office 2007 > compatibility? ...

Microsoft POS #2
I have a group of customers that I am working on setting up A bundled POS system for. I have looked at RMS and Microsoft POS. The customer's are small bulk food stores. They package all of the bulk food in various containers and weigh it with a Hobart scale producing a label with an system 2 price enbedded barcode. These are UPC A formats. They are for the most part simple single store installs and donot require the complex RMS system. I have setup the Microsoft POS version 2.0 and found it will work perfect for these customers. The only problem when you programed the system you l...

Outlook 2003 keeps crashing #2
I get this message when I look in System information. Outlook keeps crashing quite often. I cannot for example delete two messages without outlook crashing. My colleagues do not have this problem. We are using the Microsoft mail exhange server. Faulting application outlook.exe, version 11.0.5510.0, stamp 3f1380f0, faulting module mso.dll, version 11.0.5606.0, stamp 3f334cce, debug? 0, fault address 0x003b6e16. Does anyone has a solution?=20 Best regards/ Bj=F6rn 1) I would definitely apply Service Pack 2for Office 2003 + applicable critical security updates. 2) Have you tried starting O...

displaying colors in an mfc application
Hi everyone, I'm working on an MFC application. The application is a treeview in which are represented some objects (persons, roles....). I have declared some bitmaps in the visual project to represent these objects. My problem is that some colors of the bitmaps are not displayed. I guess there is a palette problem or something like that. Does anybody have an idea of what the problem is? Thanks a lot for your help.... Fred Try using ILC_COLOR24 | ILC_MASK when you create your imagelist. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "fred" <fred@laposte.net> wrot...

How can I change 'Normal' Style for Word e-mails to 'Normal (Web)'?
Hi, I'm using Word as my e-mail editor in Outlook 2003 and want to change the default Style for e-mails from 'Normal' to 'Normal (Web)'. The problem is that new e-mails and replies in HTML format use the 'Normal' Microsoft Word 'Style', and this has no gap after paragraphs. The upshot of this is that when sending an e-mail, I have to press return twice to create a gap, but when the recipient views this, their software shows it as four gaps (the extra carriage return I typed + their correctly viewed HTML carriage return after each line). E.g. I type this: ...

Filter recordset using query results
Hi all I have a form based on a query called [qry Quarterly Planning], it lists all Itineraries on the system. On this form you can filter records by specifying a Start and End Date for the [ReviewDate] and/or [Specialist]. It is a subform on a main unbound form, lets call this Subform1. Along side this I have another subform (Subform2) which displays ReviewDates that exist against an Itinerary. In other words Subform1 has a start date of an activity and if the activity lasts longer than 1 day, then the additional dates are stored in Subform2 (ItineraryDates). Currently when I...

How do I use traffic lights in excel
I am wanting to use traffic lights in excel that change colour based on the result of a variance cell, ie if the result of the cell is 10 make the traffic light green, if it is 20 make the traffic light amber, if the result is 30 make the traffic light red. How do I do this? Shorty Format>Conditional Formatting>Cell Value is: Note: you can add up to 3 conditions(4 if you count default) Gord Dibben Excel MVP On Wed, 22 Dec 2004 16:35:03 -0800, Shorty <Shorty@discussions.microsoft.com> wrote: >I am wanting to use traffic lights in excel that change colour based on the &g...

Newbie Question: Using Web Services
Hello All. I've been trying to implement Infopath with CRM with no success. I've tried the example, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmbscrm1_2/html/mbs_crminfopathcrmintegration.asp, to no avail. I have followed the example to the letter, but find the information about publishing the Web Service to the server to be somewhat lacking. Admittedly, I am not a programmer, and I am continually running into an error in line 54: xmlDoc.LoadXml(objQuery.ExecuteQuery(objBizUser.WhoAmI(), strAllAccountsFetchXML)); Has anyone else ...

Upgrade CRM 4.0 Professional to CRM 4.0 Enterprise
When I enter the CRM license code in the Deployment Manager to upgrade to Enterprise I get a message "The license code entered is not valid for upgrade. Make sure you have entered the license code correctly, and then try again". Do I have to reinstall CRM 4 to install Enterprise? Hi, what is your current installation? Professional? Have you entered trial version license keys ? /Aamir Current is Professional. I got the key from our MSDN subscription which didn't indicate a trial license. I was able to install the Enterprise edition on a test server using the same key w...

matching contents #2
E1 thru E10 contains sequentially-sorted data. B1 thru B6 contains sequentially-sorted data which matches SOME (but not ALL) of the data in Col A. For example. B E 1 1 1 2 3 2 3 4 3 4 5 4 5 6 5 6 10 6 7 7 8 8 9 9 10 10 I need to move the data in the cells in Col B next to the cells in Col E that have the same contents. For example: B E 1 1 1 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 8 8 9 9 10 10 10 Besides dr...

Please ignore #2
Testing a posting problem -- Jim Bunton ...

Using Visio HTML output within frames
Hi, I want to include visio HTML output in a frame of another html file. Unfortunately it is not working. I understood the problem is in vml_*.htm files. It is due to, the target arrtibute(pointing to _parent) in v:shapetype tag and href attribute (pointing to #) in v:shape tag. These attributes should point to "_top" and "<target-html-file>#" respectively inorder to work. I want to change these options while saving .vsd as web page? I would appreciate if you can help me in this regard. <v:shapetype id="VISSHAPE" target="_parent" coor...

Outlook freezes after sending one email after upgrading 4.0
We just upgraded from 3.0 to 4.0 this weekend. All client machines have had the desktop client upgraded and 2 have the same issue. One is XP with Outlook 2003 and the other is Vista with Outlook 2007. Open opens and the CRM addin initializes correctly. As soon as you compose and send an email, Outlook locks up and you have to kill the process in task manager to close Outlook. I've had the same problem and have tried all I can think of...how did you fix this issue? Thank you. "Sander" wrote: > We just upgraded from 3.0 to 4.0 this weekend. All client machines have...

2 register ruinning together on one z report
Is this possible, to have two registers running on one z report ? We have a small store and would like to setup a second register as a backup, temporary addition ( during rush hours) Since we are a small show i do not need to have a separate register reports. Can two registers ring up all sales together as one ? How can i set this up ? No, you can't do that. You might be able to use the Register Analysis report available in SO Manager Utilities/Crystal Reports to get something close to a single Z though. Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@tibercreek.c...

reason codes #2
I'm having a big problem tracking discounts in RMS. Whenever something is discounted up front, a reason code is set. There are several I use for discounts. However, when I try to do an Item Movement History report and select based on those reason codes, I never get any matches. When I do an item history report for a few weeks, I notice that the only reason codes that are displayed are the ones pertaining to inventory adjustment. It seems that reason codes associated with discounts do not display in this report. HELP! I need these to display to track discounts (and also store use)! ...

Outlook 2002 XP SP 3 Archive problem
Hi there I am trying to get my newly configured outlook to archive my folders. I have ust configured it to download two POP email accounts and that works fine. I have set up a set of folders below my outlook (Personal Folders / pst) inbox node and placed the relevant emails in the corresponding folders. I have gone into tools -> options -> other -> and pressed the "AutoArchive..." button -> and set the "clean out folders older than" selection boxes to "3" and "Months" and pressed the "apply these setting to all folders" button. I ...

Workbook_Open Help #2
Hello Frank, Here's the code Private Sub Workbook_Open() ' Call Unhide_Sheets ' Sheets("CONTROLPANEL").Select Range("A1").Select Call Splash End Su -- Fabl ----------------------------------------------------------------------- Fable's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=218 View this thread: http://www.excelforum.com/showthread.php?threadid=26252 Hi and there's no application.screenupdating=false statement in your unhide procedure? -- Regards Frank Kabel Frankfurt, Germany "Fable" <Fable.1d07w...

Outlook Express 5 #2
On loading, error message "MSIMN caused an invalid page fault in module DIRECTDB.dll at 017f:7dbf3070.." Appeared to coincide with display config change? Ask in an Outlook Express forum. This is an Microsoft Office Outlook forum. Outlook Express is family of Internet Explorer and Outlook of the Office family. Here is the link for the right forum http://communities.microsoft.com/newsgroups/default.asp?icp=InternetExplorer Good Luck! -- Roady [MVP] www.sparnaaij.net Microsoft Office and Microsoft Office related News Also Outlook FAQ, How To's, Downloads and more... Tip of...