Changing Registry programaticly

Posted on 2004-11-21
Last Modified: 2013-11-20
Hi to all!
I'm trying to change "GlobalUserOffline" in registry from my application.
this is the code I'm using:

HKEY hkey;
DWORD m_tmpWord;
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", 0, KEY_ALL_ACCESS, &hkey);

When I start application everything looks OK, but there isn't any change in registry.
What I'm doing wrong.

OS is Windows 2000, IE 6.

Question by:KukiPei
    LVL 55

    Accepted Solution

    Try to use RegOpenKeyEx with KEY_READ security attribute.

    Author Comment

    It doesn't work.

    Author Comment

    I solved the problem.

    Insted of HKEY_LOCAL_MACHINE I use HKEY_CURRENT_USER and everything work fine.

    Becouse you are the only one who respond to my question I'l give you all points.
    Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
    Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 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

    11 Experts available now in Live!

    Get 1:1 Help Now