Results 1 to 9 of 9

Thread: Emulating the "APPLY" button within the Appearance options "Refresh the new settings"

  1. #1

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Angry Emulating the "APPLY" button within the Appearance options "Refresh the new settings"

    Hi Guys,

    I'm needing some help with this one. I've got a copy of the HKCU\Control Panel hive and need to apply this to the registry and then "apply" the changes. The problem lies with "refreshing" the registry so that the changes apply.

    Here's an example:

    1. Open Regedit and change the following key = HKCU\Control Panel\Colors\Background to 0 0 0 (black, or any choice of color!) and close regedit.

    2. To apply the changes, a user needs to log off and then back in. This is no good.

    I've tried running TSKILL explorer.exe but this does not help either..

    Any help would be great.
    Last edited by Chrispybee; Jan 27th, 2006 at 03:55 PM. Reason: wrong title

  2. #2

  3. #3

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: Apply changes to HKCU\Control Panel and "Refresh the new settings"

    Hey,

    When a user changes their appearance settings (background color, etc) and selects Apply. This does the registry changes needed and then does a "Refresh" and the screen has all the correct settings applied. I'm trying to find out how to do this.

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Apply changes to HKCU\Control Panel and "Refresh the new settings"

    Hmmm... Ever consider API path?
    VB Code:
    1. Private Declare Function SetSysColors Lib "user32" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long) As Long
    2. Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
    3.  
    4. Const COLOR_SCROLLBAR = 0 'The Scrollbar colour
    5. Const COLOR_BACKGROUND = 1 'Colour of the background with no wallpaper
    6. Const COLOR_ACTIVECAPTION = 2 'Caption of Active Window
    7. Const COLOR_INACTIVECAPTION = 3 'Caption of Inactive window
    8. Const COLOR_MENU = 4 'Menu
    9. Const COLOR_WINDOW = 5 'Windows background
    10. Const COLOR_WINDOWFRAME = 6 'Window frame
    11. Const COLOR_MENUTEXT = 7 'Window Text
    12. Const COLOR_WINDOWTEXT = 8 '3D dark shadow (Win95)
    13. Const COLOR_CAPTIONTEXT = 9 'Text in window caption
    14. Const COLOR_ACTIVEBORDER = 10 'Border of active window
    15. Const COLOR_INACTIVEBORDER = 11 'Border of inactive window
    16. Const COLOR_APPWORKSPACE = 12 'Background of MDI desktop
    17. Const COLOR_HIGHLIGHT = 13 'Selected item background
    18. Const COLOR_HIGHLIGHTTEXT = 14 'Selected menu item
    19. Const COLOR_BTNFACE = 15 'Button
    20. Const COLOR_BTNSHADOW = 16 '3D shading of button
    21. Const COLOR_GRAYTEXT = 17 'Grey text, of zero if dithering is used.
    22. Const COLOR_BTNTEXT = 18 'Button text
    23. Const COLOR_INACTIVECAPTIONTEXT = 19 'Text of inactive window
    24. Const COLOR_BTNHIGHLIGHT = 20 '3D highlight of button
    25. Const COLOR_2NDACTIVECAPTION = 27 'Win98 only: 2nd active window color
    26. Const COLOR_2NDINACTIVECAPTION = 28 'Win98 only: 2nd inactive window color
    27.  
    28. Private Sub Command1_Click()
    29.     'KPD-Team 1998
    30.     'URL: [url]http://www.allapi.net/[/url]
    31.     'E-Mail: [email][email protected][/email]
    32.     'Get the caption's active color
    33.     col& = GetSysColor(COLOR_ACTIVECAPTION)
    34.     'Change the active caption's color to red
    35.     t& = SetSysColors(1, COLOR_ACTIVECAPTION, RGB(255, 0, 0))
    36.     MsgBox "The old title bar color was" + Str$(col&) + " and is now" + Str$(GetSysColor(COLOR_ACTIVECAPTION))
    37. End Sub

  5. #5

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: Apply changes to HKCU\Control Panel and "Refresh the new settings"

    I've managed to do what I wanted but I'm not too sure if it's the correct way.

    I change the background value from HKCU\Control Panel\Colors - read the value from the key and then set if using the posting above.

    I want to know if I can use the same class/method or API call that the "APPLY" button uses under Appearance?

    Or

    When selecting the "APPLY" button does it write all the registry keys dynamically?

    Any thoughts?

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Apply changes to HKCU\Control Panel and "Refresh the new settings"

    Quote Originally Posted by Chrispybee
    ...I want to know if I can use the same class/method or API call that the "APPLY" button uses under Appearance?

    Or

    When selecting the "APPLY" button does it write all the registry keys dynamically?

    Any thoughts?
    Not sure what you mean...

  7. #7
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: Emulating the "APPLY" button within the Appearance options "Refresh the new settings"

    in windows, some settings need requires the computer to be restarted in order for it to SAFELY take effect. this is normal with every platform because if a setting is already in use and you are going to change it, the operating system needs to reload it to memory and reloading requires the unloading of the previous one.

    so for the sake of safe operation, i suggest you follow the way the operating system operates
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  8. #8

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: Emulating the "APPLY" button within the Appearance options "Refresh the new settings"

    What I mean is the following...

    1. Right click on the Desktop and select Properties.
    2. Select the Appearance tab and change the color of the desktop.
    3. Select the APPLY button the following registry key should be changed and applied.
    * This will or should change the "HKCU\Control Panel\Colors" Background value.

    My question is fairly simple. If you use WinSpector and monitor the RUNDLL32.EXE a class is called but is hidden by the OS. Does anyone have any information on such a class or function within the USER32.DLL which I could use to read and apply all registry settings dynamically. Windows does it so it should be done??

  9. #9

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Re: Emulating the "APPLY" button within the Appearance options "Refresh the new settings"

    Can anyone help on this?

    Please, I need to know if this can be done?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width