CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Dec 2020
    Posts
    11

    Resolved Registry - Check for key or value Hello, I am trying to check for the existance of

    Registry - Check for key or value

    Hello,

    I am trying to check for the existance of a key or value in the registry.
    I know how to write the values,
    Code:
    RegSetKeyValue(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "StartupBuddy", REG_SZ, "0", 1);
    Code:
    RegSetKeyValue(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "StartupBuddy", REG_SZ, "1", 1);


    Code:
    CreateWindow(TEXT("BUTTON"),// * GroupBox
     TEXT("Startup Settings"),
     WS_VISIBLE | WS_CHILD | BS_GROUPBOX | BS_CENTER,
     10, // Start Left
     10, // Start Top
     WidthX - 25,
     50,
     hwnd,
     (HMENU) ID_GroupBox_StartupSettings,
     NULL,
     NULL);
    					
    CreateWindow(TEXT("BUTTON"),// * CheckBox
     TEXT("Start with Windows"),
     WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
     30, // Start Left
     25, // Start Top
     150,
     30,
     hwnd,
     (HMENU) ID_CheckBox_WindowsStartup,
     NULL,
     NULL);


    But do not know how to check for them
    check for value in registry, if found
    Code:
    CheckDlgButton(hwnd, ID_CheckBox_WindowsStartup, BST_CHECKED);
    Thank you.
    Last edited by NewPlaza; March 12th, 2023 at 01:35 PM.

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

Featured