Heres a GUI & UDFs
Example Of Use:
Example Of GUI:
#include <GUIConstants.au3> #Include <GuiListView.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("AForm1", 571, 429, 193, 115) $ListView1 = GUICtrlCreateListView("Protocol|Command", 0, 1, 570, 382) _GUICtrlListViewSetColumnWidth( $ListView1, 0, 80 ) _GUICtrlListViewSetColumnWidth( $ListView1, 1, 470 ) $Button1 = GUICtrlCreateButton("Get Protocols", 235, 392, 80, 33, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ProgressOn( "Searching", "Please Wait" ) _GUICtrlListViewDeleteAllItems ( $ListView1 ) $array = _ProtocolGet() ProgressOff() For $i = 0 To UBound( $array, 1 )-1 _GUICtrlListViewInsertItem ( $ListView1, -1, $array[$i][0]&"|"&$array[$i][1] ) Next EndSwitch WEnd #cs Function: _ProtocolDelete Discription: Deletes a protocol from the registry. Params: $protocol The name of the protocol WARNING: Using this improperly can cause problems make sure you only delete a protocol you created or you know will not take effect on your computer. #ce Func _ProtocolDelete($protocol) RegDelete( "HKEY_CLASSES_ROOT\"&$protocol ) If @error Then Return @error Else Return 1 EndIf EndFunc #cs Function: _ProtocolCreate Discription: Creates a protocol and assigns a name and command to it. Params: $protocol = The protocol $name = The name of the protocol $command = The command to run note: use "%1" after the program to add the url #ce Func _ProtocolCreate($protocol, $name, $command) RegWrite("HKEY_CLASSES_ROOT\"&$protocol) RegWrite("HKEY_CLASSES_ROOT\"&$protocol, "", "REG_SZ", "URL:"&$name) RegWrite("HKEY_CLASSES_ROOT\"&$protocol, "URL Protocol", "REG_SZ", "") RegWrite("HKEY_CLASSES_ROOT\"&$protocol&"\shell\open\command") RegWrite("HKEY_CLASSES_ROOT\"&$protocol&"\shell\open\command", "", "REG_SZ", $command) EndFunc #cs Function: _ProtocolGet Discription: Gets the protocols from the registry using a two dimension array. $array[index][0] = Protocol $array[index][1] = Command Params: None #ce Func _ProtocolGet() Local $i = 0 Local $ii = 0 Dim $protocolarray[1][2] While 1 $i = $i + 1 $protocol = RegEnumKey("HKEY_CLASSES_ROOT", $i) If @error <> 0 then Return $protocolarray Else RegRead("HKEY_CLASSES_ROOT\"&$protocol, "URL Protocol") If @error = 0 Then $command = RegRead("HKEY_CLASSES_ROOT\"&$protocol&"\shell\open\command" , "") If @error = 0 Then ReDim $protocolarray [$ii+1][2] $protocolarray[$ii][0] = $protocol $protocolarray[$ii][1] = $command $ii = $ii + 1 EndIf EndIf EndIf WEnd EndFunc
Edited by CyberZeroCool, 15 June 2007 - 04:22 PM.





