FireFox Posted December 26, 2008 Posted December 26, 2008 (edited) Hi,I want to add Icon on contextmenu like this :Ive made script for create or delete contextmenu items :expandcollapse popup$choice = InputBox("ContextMenu <d3montools>", "1 = File Contextmenuitem" & @CRLF _ & "2 = Folder Contextmenuitem" & @CRLF _ & "3 = Folder && File Contextmenuitem" & @CRLF _ & "4 = Delete created Contextmenuitem" & @CRLF _ & "x = Exit", "1", "", 250, 175) If $choice = 1 Then _File() ElseIf $choice = 2 Then _Folder() ElseIf $choice = 3 Then _File() _Folder() ElseIf $choice = 4 Then _Delete() EndIf Func _Delete() $choice = InputBox("ContextMenu <d3montools>", "1 = Delete File Contextmenuitem" & @CRLF _ & "2 = Delete Folder Contextmenuitem" & @CRLF _ & "3 = Delete File && Folder Contextmenuitem", "1", "", 250, 175) If $choice = 1 Then $delfilecm = InputBox("ContextMenu <d3montools>", "Enter name of contextmenuitem you want to delete", "New ContextItem", "", 280, 75) If Not @error Then RegDelete("HKEY_CLASSES_ROOT\*\shell\" & $delfilecm) If Not @error Then MsgBox(64, "Context Menu", "Context menu successfully deleted !") Else MsgBox(16, "Context Menu", "Error while deleting context menu !") Exit EndIf EndIf ElseIf $choice = 2 Then $delfoldercm = InputBox("ContextMenu <d3montools>", "Enter name of contextmenuitem you want to delete", "New ContextItem", "", 280, 75) If Not @error Then RegDelete("HKEY_CLASSES_ROOT\Folder\shell\" & $delfoldercm) If Not @error Then MsgBox(64, "Context Menu", "Context menu successfully deleted !") Else MsgBox(16, "Context Menu", "Error while deleting context menu !") Exit EndIf EndIf ElseIf $choice = 3 Then $delbothcm = InputBox("ContextMenu <d3montools>", "Enter name of contextmenuitem you want to delete", "New ContextItem", "", 280, 75) If Not @error Then RegDelete("HKEY_CLASSES_ROOT\*\shell\" & $delbothcm) RegDelete("HKEY_CLASSES_ROOT\Folder\shell\" & $delbothcm) If Not @error Then MsgBox(64, "Context Menu", "Context menu successfully deleted !") Else MsgBox(16, "Context Menu", "Error while deleting context menu !") Exit EndIf EndIf EndIf EndFunc ;==>_Delete Func _File() $file = FileOpenDialog("Select file to execute in context menu", "", "Application (*.exe)", 1 + 2, @SystemDir & "\Notepad.exe") If Not @error Then $text = InputBox("ContextMenu <d3montools>", "Enter name for context menu item", "New ContextItem", "", 250, 75) If Not @error Then RegWrite("HKEY_CLASSES_ROOT\*\shell") RegWrite("HKEY_CLASSES_ROOT\*\shell\" & $text) RegWrite("HKEY_CLASSES_ROOT\*\shell\" & $text & "\command") RegWrite("HKEY_CLASSES_ROOT\*\shell\" & $text & "\command", "", "REG_SZ", $file & " %1") If Not @error Then MsgBox(64, "Context Menu", "Context menu successfully created !") Else MsgBox(16, "Context Menu", "Error while creating context menu !") Exit EndIf Else Exit EndIf Else Exit EndIf EndFunc ;==>_File Func _Folder() $folder = FileOpenDialog("Select file to execute in context menu", "", "Application (*.exe)", 1 + 2, @SystemDir & "\Notepad.exe") If Not @error Then $text = InputBox("ContextMenu <d3montools>", "Enter name for context menu item", "New ContextItem", "", 250, 75) If Not @error Then RegWrite("HKEY_CLASSES_ROOT\Folder\shell") RegWrite("HKEY_CLASSES_ROOT\Folder\shell\" & $text) RegWrite("HKEY_CLASSES_ROOT\Folder\shell\" & $text & "\command") RegWrite("HKEY_CLASSES_ROOT\Folder\shell\" & $text & "\command", "", "REG_SZ", $folder & " %1") If Not @error Then MsgBox(64, "Context Menu", "Context menu successfully created !") Else MsgBox(16, "Context Menu", "Error while creating context menu !") Exit EndIf Else Exit EndIf Else Exit EndIf EndFunc ;==>_FolderThanks for anyhelp Best regards, FireFox Edited December 26, 2008 by FireFox
FireFox Posted December 26, 2008 Author Posted December 26, 2008 (edited) Updated script ! Edit : I create my context menu on "HKEY_CLASSES_ROOT\*" key but I see that AutoIt create one's on "HKEY_CLASSES_ROOT\AutoIt3Script" where I can read "Default Icon" so the way is I want to do same thing but on all files Thanks for anyhelp Cheers, FireFox. Edited December 26, 2008 by FireFox
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now