Custom Theme or Style to Hide UI Elements?


  1. Posts : 2
    Windows 7 x64
       #1

    Custom Theme or Style to Hide UI Elements?


    First off - great resource - it look like a great community with lots of valuable knowledge!

    I've perused some of the forums and either haven't been able to form the search the way I want or the topic hasn't been touched on. I hope someone here with the experience in UI customization might either be able to answer my question or point me in the right direction.

    I need to change the Windows 7 skin (Aero Theme?) to remove the power options section from the UI. (The button that shows Shut down, Log off, Restart, Hibernate, etc). (See attached picture: StartMenu.jpg)
    Custom Theme or Style to Hide UI Elements?-startmenu.jpg

    We want to use Windows 7 in a VDI environment and we would prefer for users to "Disconnect" - and while it is an option on the flyout menu, it cannot be set as the default for the button (using GPO or local policy/registry configuration). We have coded our own disconnect solution, but to prevent user confusion we want to eliminate the other option.

    1. Is it possible to outright eliminate UI features (such as buttons, user tile, etc) through a custom theme or style? (Possibly a compiled replacement for aero.msstyles?)
    2. If the answer to #1 is no, is there a relativly easy way to replace the shell with a duplicate that does not have these options in the UI?
    3. What tool(s) do I need to build a solution to make this change?
    I've seen some pretty amazing re-skinning of the UI and thought this might be easy to do, but it seems that suppressing core OS features is not a simple task.

    Thanks in advance for assistance,
    Andy
      My Computer


  2. Posts : 2
    Windows 7 x64
    Thread Starter
       #2

    I got an answer in the form of some C code:

    Code:
    int wmain(int argc, wchar_t* argv[])
    {
        HWND hwndStart;
        HWND hwndLogoffPane;
        HWND hwndLogoffButton;
        UINT nShow = SW_HIDE;
    
        if (argc > 1)
        {
            switch (_wtoi(argv[1]))
            {
            case 0:
                nShow = SW_SHOW;
                break;
    
            default:
                nShow = SW_HIDE;
                break;
            }
        }
    
        hwndStart = FindWindow(L"DV2ControlHost", L"Start menu");
        if (hwndStart)
        {
            hwndLogoffPane = FindWindowEx(hwndStart, NULL, L"DesktopLogoffPane", NULL);
            if (hwndLogoffPane)
            {
                hwndLogoffButton = GetWindow(hwndLogoffPane, GW_CHILD);
                if (hwndLogoffButton)
                {
                    ShowWindow(hwndLogoffButton, nShow);
                }
            }
        }
    
        return 0;
    }
    Good luck :)
    Last edited by larray; 30 Nov 2010 at 11:31. Reason: Add code tags
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:05.
Find Us