Announcement

Collapse
No announcement yet.

How to make Windows re-read Registry?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to make Windows re-read Registry?

    I have written a program (well, will re-write it) that toggles
    the data/audio CD autorunning feature of Windows. The audio CD
    feature, when toggled, takes effect immediately, as noted in
    MSDN. But, MSDN says that the data autorunning feature uses a
    "persistent" key in the Registry. I assume that that's why
    changes to the key's value don't take effect until after I reboot
    my machine. However, StepUp has an autorunning feature toggler
    in its program, BUT, unlike my program, changes it makes to the
    data autorunning take effect in realtime, WITHOUT requiring a
    reboot. So, how can I make MY program do the same?

    Semen,

    I tried the API Call that you thought were necessary in my
    posting on the same subject a LONG time ago. I tried MANY
    variations of calls to the API function, and none of them worked.


    So, anybody have any ideas? I'm SURE that the key to it is
    getting the OS to re-read the Registry. But, that's only a
    guess. My OS is Win98SE.

    Any ideas would be GLADLY and GRATEFULLY received!

    Thanks in advance!


    ------------------
    Clay C. Clear

    [email protected]

    http://www.v3space.com/a/a39/202/

  • #2
    Maybe broadcasting a %WM_SETTINGCHANGE message would do it... see SystemParametersInfo() in WIN32.HLP, or try:
    Code:
    SendMessage %HWND_BROADCAST, %WM_SETTINGCHANGE, 0&, 0&

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]tra.co.nz

    Comment


    • #3
      Lance,

      THANK YOU EVER SO MUCH! After adding the SendMessage line that you posted to
      the end of my temporary TEST program, the program performed FLAWLESSLY!
      The program didn't even require SHChangeNotify! NOW, I can *FINALLY*
      write the PUBLIC RELEASE version of my CD Autorun toggling program!
      AND I can uninstall StepUp! Don't get me wrong - StepUp is a FINE program, but I
      don't appreciate having to install the full suite of 5 (or 6?)
      programs just to use the one feature.

      Thanks, again! You're a lifesaver! <big toothy grin>




      ------------------
      Clay C. Clear

      [email protected]

      http://www.v3space.com/a/a39/202/

      Comment

      Working...
      X