VB6 / Windows XP - Apply System Visual Style And Profile

Posted on 2004-11-02
Last Modified: 2009-06-29

The scenario is i'm making a small tool which applies themes and general settings without using the display control panel. Think along the lines of Style XP.. only much more simple.
My question is as follows. Using VB6 I want to force a system-wide theme apply. Windows has a built in ability to save all theme settings to .theme file (colours, visual style etc.) using the Display Control Panel. How can i make windows apply, for example C:\MyTheme.Theme.
Shelling the file opens the Display control panel with the theme ready to load, but you have to click 'apply'. This is not adiquate. (nor is sending a key press to apply the theme from that point). So, In a nutshell, i need to use VB6 programming code to apply a '.Theme' file.

Any code or directions which can achieve my goal will be accepted. As a compromise, i will also accept an answer which tells me how to switch visual style from classic to luna, or luna silver. If anyone knows how i can force XP to use its new 'modern' start menu instead of the 'classic' one in VB6 programming code would also be appriciated.

Thankyou in advance,

Question by:dgc_lexxy
    LVL 10

    Expert Comment


    Author Comment

    Thanks for your response anv. Unfortunatly i am not looking to apply an XP Visual style to my VB application only. I am refering to the entire system. I need to change the system theme. Allow me to further elaborate.
    The system loads in the 'Classic' Style. Windows Is Using the 'Classic' Theme.. I want to use programming code to switch the system from 'Classic' Style To An XP Visual Theme, Preferably By Loading A '.Theme' File Which The Display Control Panel Nativly Saves Themes To. Think along the lines that im making a display control panel replacement. Windows Is Also Using The 'Classic' **Start** Menu. If any help can be offered to use programming code/api to switch from 'classic' start menu to 'modern' start menu that would be appriciated, but i will accept any answer which completes my goal of changing the **system** theme.

    Thanks Again,

    LVL 10

    Accepted Solution

    hi dgc_lexxy

    check the link below..

    it is using Delphi .. but i feel u can easily try and make it in Vb..

    add a reference to the ThemeUI ActiveX library. as mentioned in the link and  follow the steps..
    giving proper syntax in VB..

    try and let me know..

    Author Comment

    Brilliant. ThemeUI.dll provided the required functions.
    Thanks alot.
    LVL 1

    Expert Comment

    Hey Lexx, how did you get this going in the end? via VB perhaps? Would love to know how.


    Expert Comment

    i get "access denied" , is the problem that iam running in sp2 where themeui.dll have some kind of security ? if iam right, then how could i use the sp1 dll ?

    replay pls

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now