How to read the DWORD value from REGISTRY with the help of VB6 (visual basic) in Window XP? RRS feed

  • Question

  • Hi;

    i want to read the DWORD value from REGISTRY and store the value of the DWORD into one variable. And i want to do it in VB6.

    i know how to insert DWORD value in to the Registry & i have done it in the following way:-

    And the codes for the above image is as follows:-


    Private Sub Command1_Click()
    If Check1.Value = Checked Then
      'This program is to enable/disable the TASK MANAGER

    A = Shel l("REG add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 1 /f", vbNormalFocus)
        A = Shell("REG add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 0 /f", vbNormalFocus)
    End If
    End sub


    Now the problem is that i want to retrieve the DWORD value of  "DisableTaskMgr" which is in "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" directry of  the registry in an variable "x" so that if the above program is again executed then it can run  the following commands:-


    if x. value = 1 then

    msgbox("Taskmgr is already disabled");

    else if  x. value = 0 then

    msgbox("Taskmgr is already enabled");

    end if


    please help me with some easy codes

    Thank U...

    • Edited by Bishesh9 Friday, March 9, 2012 12:14 PM
    • Moved by Jie Bao Monday, March 12, 2012 8:22 AM (From:Visual Basic General)
    Friday, March 9, 2012 12:12 PM