Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 10-31-2006, 05:29 AM custom title bar
Average Talker

Posts: 23
Name: Amit
Trades: 0
i wish to change the default looks of applications made in visual c++. how do we do that?
__________________

Please login or register to view this content. Registration is FREE
storyera is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-02-2006, 02:33 AM Re: custom title bar
Novice Talker

Posts: 7
Name: Nadeem Abbasi
Location: Pakistan
Trades: 0
1. Create a Manifest File

Microsoft has introduced a new type of resource called Manifest. Well, technically it's not a type of resource; it is just an XML file included to the app as a custom resource with ID=1, which describes the application and its dependencies. If an executable file contains this resource, Windows XP will identify it and force the application to use the specific versions of libraries. Our goal is to enforce usage of new Windows Common Controls library (version 6).
Here is an example of a simple manifest file that I've used to solve this task:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Microsoft.Windows.YourApplication" type="win32"/><description>YourApplication</description><dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly></dependency></assembly>Create a file with its contents as shown above in the project resources folder (res by default). Replace YourApplication with an appropriate name. That should do it for our case. For further information about manifest files, see the MSDN for Visual Studio .NET.
2. Add a Resource to the .rc File

First, let's add two lines to the resource.h file. Just copy and paste the following:
#define IDR_MANIFEST 1#define RT_MANIFEST 24Now, open the application custom resource file. Usually, it's located in the res directory; the default extention is .rc2. Manually add the following line:
// Add manually edited resources here...IDR_MANIFEST RT_MANIFEST MOVEABLE PURE "res\\ApplicationManifestXMLFile"Replace ApplicationManifestXMLFile with the actual file name.
3. Modify the InitInstance Method

It's really simple. Just copy and paste two calls at the beginning of the InitInstance method:
BOOL MoneyApp::InitInstance(){ InitCommonControls(); // initialize common control library CWinApp::InitInstance(); // call parent class method#ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a // shared DLL#else Enable3dControlsStatic(); // Call this when linking to MFC // statically#endif // the rest of the code}
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
NadeemAbbasi is offline
Reply With Quote
View Public Profile
 
Old 11-03-2006, 07:26 AM Re: custom title bar
Average Talker

Posts: 23
Name: Amit
Trades: 0
that is not required!
__________________

Please login or register to view this content. Registration is FREE
storyera is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to custom title bar
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.35041 seconds with 12 queries