XP Themes !

Submitted on: 2/13/2015 7:12:00 PM
By: Mark Anthony Dinglasa (from psc cd)  
Level: Intermediate
User Rating: By 2 Users
Compatibility: VB 6.0
Views: 1137
     Hi there everybody !...I just want to share this one, this is not mine and I give credits to Thomas Spink. This is very useful when your OS is Windows Xp.Even if you have an OS XP, all controls in Visual basic still the same.It transform all controls in visual basic to XP style. And it is very simple to do.

				Microsoft Windows XP is the latest version of Windows. It includes many new features and updates to the Common Controls Library. One of the main features is the Windows XP Themes. This allows you to select a theme, and the entire look and feel of Windows, as you know it will change. However, if you were to write a program in VB, the buttons, textboxes you were to use, would not change. You need to tell Windows XP that you are going to use the new version of the Common Controls Library, and to do this you must include an application manifest. A manifest is an XML document that Windows XP searches for in the application’s directory when you open an application. This manifest tells Windows XP to use the new version of COMCTL32.DLL (Version 6). Here is a brief tutorial on creating an application manifest, for Visual Basic:
1.Load Microsoft Visual Basic and start a new project
2.Now add a few standard controls, a button, a checkbox, two option buttons and a text box 
Give them captions, and program the button to Exit when clicked.
Private Sub Command1_Click()
 Unload Me
End Sub
COMCTL32.DLL exports a function called InitCommonControls. This is exported in COMCTL32.DLL versions from Windows 95. This needs to be called when the application is started, to ensure that the common controls library is opened. The declaration is not available in the API viewer. Make sure that you use Form_Initialize and not Form_Load, to enter the code. So the code in the form should now read:
Option Explicit
Private Declare Function InitCommonControls Lib "comctl32.dll" () As Long
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Initialize()
End Sub 
Now we need to compile this into an executable file (the manifest will only work when run as an EXE) and actually create the manifest. I have called my application COMCTLTest.EXE. You can call your executable anything, but that name needs to correspond with the name on the manifest. 
Go to the folder, at which you have compiled the application into, load notepad and enter the following: 

Any Description Here


Save this as:
So because I compiled my application as COMCTLTest.exe I would save my manifest as: COMCTLTest.EXE.MANIFEST
Now, you are ready to run your application. Double click on the executable, and there you are!!
Credits to:Thomas Spink, Age

Other 12 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.