Jump to content

[ HOW TO DO THIS ] CHECKBOX - STATE


star2
 Share

Recommended Posts

hi another question for u all

my question is

I have a checkbox and I want to make a relation between it

and the existance of a registry value

here's the GUI

; create the GUI
#include <GUIConstants.au3>
GUICreate  ("checbox state", 200,100)
GUISetFont (12)
GUISetState ()
; ======================

$apply1 = GUICtrlCreateButton ("Apply",6,60,80)
$panel = GUICtrlCreateCheckbox ("Control Panel", 6,20)
; ======================

While 1
    $msg = GUIGetMsg()
            If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        If  $msg = $apply1 Then
            If BitAND(GUICtrlRead($panel),$GUI_CHECKED) = 1 Then
                RegWrite ("HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\ControlPanel","","REG_EXPAND_SZ","@%SystemRoot%\system32\shell32.dll,-30488")
                RegWrite ("HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\ControlPanel\command","","REG_SZ","rundll32.exe shell32.dll,Control_RunDLL")
            Else
                RegDelete ("HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\ControlPanel")
            EndIf
        EndIf
WEnd

what I need is that

I want the program to check the Registry records for the following key

HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\ControlPanel

if the key exists I want the checkbox to be in checked state otherwise unchecked.

so please help me find a way for this

Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

thanks for responding

actually I tried to use RegRead () but still gives me error when making $var = RegRead()

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

maybe...

if you RegRead() the key and it @error = 0 then it exists else it doesnt

in theory...

RegRead("HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\ControlPanel","")
If Not @error Then
    ;its there
Else
    ;its not there
EndIf
u're the man

it worked perfectly

thanks and 1000 thanks

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...