Jump to content

CPanel


Michel Claveau
 Share

Recommended Posts

Hi!

My english is bad. Read the code!

#cs
CPanel is able to create an entry in the control panel, targeting one of your exe(s).
    
Usage : 
    - create un new/unique GUID
    - fill variables
    - run
    - go to Control_Panel, for try
    - send 51000000 $ to Michel Claveau, for thanks...
#ce

$GUID="{00000000-0000-0000-C000-000000000099}"
$localizedstring="MySoft: Configuration-Center"
$infotip="The confiiiiiiiiiiiiiig of my soft"
$categories=""
$appliname="mysoft"
;FileInstall("D:\Dev\autoit\mysoft.ico","C:\mys\",1)
$icon="C:\mys\mysoft.ico"
$command="C:\mys\mysoft.exe"


$tkey="HKEY_CLASSES_ROOT\CLSID\"&$GUID
RegWrite($tkey)
RegWrite($tkey&"\Shell")
RegWrite($tkey&"\Shell\Open")
RegWrite($tkey&"\Shell\Open\Command")
RegWrite($tkey&"\Shell\Open\Command","","REG_SZ",$command)

RegW($tkey,"LocalizedString","REG_EXPAND_SZ",$localizedstring)
RegW($tkey,"InfoTip","REG_EXPAND_SZ",$infotip)
RegW($tkey,"System.ApplicationName","REG_SZ",$appliname)
If $categories<>"" Then
    RegW($tkey,"System.ControlPanel.Category","REG_SZ",$categories)
EndIf

RegWrite($tkey&"\DefaultIcon")
RegW($tkey&"\DefaultIcon","","REG_EXPAND_SZ",$icon)

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\ControlPanel\NameSpace\"&$GUID) 

Exit


Func RegR($clef,$valeur)
    $v=RegRead($clef,$valeur)
    #cs
    If @error Then
        If @error= 1 Then MsgBox(0,"Erreur", "unable to open requested key ") 
        If @error= 2 Then MsgBox(0,"Erreur", "unable to open requested main key ") 
        If @error= 3 Then MsgBox(0,"Erreur", "unable to remote connect to the registry ") 
        If @error= -1 Then MsgBox(0,"Erreur", "unable to open requested value ") 
        If @error= -2 Then MsgBox(0,"Erreur", "value type not supported ") 
    EndIf
    #ce
    Return $v
EndFunc


Func RegW($clef, $valeur, $typ, $contenu)
    $v2=RegR($clef,$valeur)
    If $v2=$contenu Then
        Return
    EndIf
    
    $v=RegWrite($clef, $valeur, $typ, $contenu)
    If @error Then
        If @error= 1 Then MsgBox(0,"Erreur", "unable to open requested key ") 
        If @error= 2 Then MsgBox(0,"Erreur", "unable to open requested main key ") 
        If @error= 3 Then MsgBox(0,"Erreur", "unable to remote connect to the registry ") 
        If @error= -1 Then MsgBox(0,"Erreur", "unable to open requested value ") 
        If @error= -2 Then MsgBox(0,"Erreur", "value type not supported ") 
    EndIf

    $v2=RegR($clef,$valeur)
    If $v2<>$contenu Then
        MsgBox(0,"Problème avec REG",$clef &@CRLF& $valeur &@CRLF& $contenu &"   vs   "& $v2)
    EndIf

    Return $v
EndFunc

If you prefer, you can replace the .exe by a .bat, or a command-line.

Info ; categories possible are (sorry, in french) :

1 - apparence & personnalisation (personnalization)

2 - Matériel & audio (hard & sound)

3 - Réseau & Internet (LAN & Net)

4 - non utilisé

5 - Système (System)

6 - Horloge, Langue (Clock, Language)

7 - Ergonomie

8 - Programmes (softwares)

9 - Utilisateurs (users)

10- Sécurité (sécurity)

11- Mobile

Several categories is possible (example : "5,9") ; or anything

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...