Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Ediraser - Form1.frm

Form1.frm

Caricato da: Natamas
Scarica il programma completo

  1. Const chiave = "HKEY_CLASSES_ROOT\CLSID\{2559a1f6-21d7-11d4-bdaf-00c04f60b9f0}"
  2.  
  3. Private Sub Check1_Click()
  4. If Check1.Value = 1 Then
  5. ico_tex.Enabled = False
  6. icon_b.Enabled = False
  7. If file_tex.Text <> "" Then
  8. ico_tex.Text = file_tex.Text & ",0"
  9. Else
  10. MsgBox "Selezionare prima il file da eseguire", vbExclamation, App.Title
  11. Check1.Value = 0
  12. End If
  13. Else
  14. ico_tex.Enabled = True
  15. icon_b.Enabled = True
  16. ico_tex.Text = Dialog2.FileName
  17. End If
  18. End Sub
  19.  
  20. Private Sub eseg_Click()
  21. If tit_tex.Text <> "" And desc_tex.Text <> "" And file_tex.Text <> "" And ico_tex.Text <> "" Then
  22. Call scrivi
  23. Else
  24. MsgBox "Inserire prima tutti i dati richiesti", vbExclamation, App.Title
  25. End If
  26. End Sub
  27.  
  28. Private Sub eseguib_Click()
  29. Dialog1.ShowOpen
  30. If Dialog1.FileName <> "" And Dir(Dialog1.FileName) <> "" Then
  31. file_tex.Text = Trim$(Dialog1.FileName)
  32. ElseIf Dialog1.FileName = "" Then
  33. MsgBox "Non hai selezionato nessun file, riprovare !", vbExclamation, App.Title
  34. Else
  35. MsgBox Chr(34) & Dialog1.FileTitle & Chr(34) & " non esiste, riprovare !", vbExclamation, App.Title
  36. End If
  37. End Sub
  38.  
  39. Private Sub ex_Click()
  40. Unload Me
  41. End
  42. End Sub
  43.  
  44. Private Sub Form_Load()
  45. Me.Caption = App.Title & "  -  " & App.LegalCopyright
  46. End Sub
  47.  
  48. Private Sub Form_Unload(Cancel As Integer)
  49. Unload Me
  50. End
  51. End Sub
  52.  
  53. Private Sub icon_b_Click()
  54. Dialog2.ShowOpen
  55. If Dialog2.FileName <> "" And Dir(Dialog2.FileName) <> "" Then
  56. ico_tex.Text = Trim$(Dialog2.FileName)
  57. ElseIf Dialog2.FileName = "" Then
  58. MsgBox "Non hai selezionato nessun file, riprovare !", vbExclamation, App.Title
  59. Else
  60. MsgBox Chr(34) & Dialog2.FileTitle & Chr(34) & " non esiste, riprovare !", vbExclamation, App.Title
  61. End If
  62. End Sub
  63.  
  64. Sub scrivi()
  65. CreaChiave chiave & "\DefaultIcon"
  66. CreaChiave chiave & "\Instance\InitPropertyBag"
  67. ScriviChiaveStringa chiave, "", tit_tex.Text
  68. ScriviChiaveStringa chiave, "InfoTip", desc_tex.Text
  69. ScriviChiaveStringa chiave & "\DefaultIcon", "", ico_tex.Text
  70. ScriviChiaveStringa chiave & "\Instance\InitPropertyBag", "Command", tit_tex.Text
  71. ScriviChiaveStringa chiave & "\Instance\InitPropertyBag", "method", "ShellExecute"
  72. ScriviChiaveStringa chiave & "\Instance\InitPropertyBag", "Param1", file_tex.Text
  73. MsgBox "Funzione eseguita, ora verrà riavviato Explorer", vbInformation, App.Title
  74. Call Riavvio
  75. End Sub
  76.  
  77. Sub Riavvio()
  78. For Each obj In GetObject("winmgmts:").ExecQuery("SELECT * FROM Win32_Process WHERE Name='explorer.exe'")
  79.      obj.Terminate
  80. Next
  81. Shell ("explorer.exe")
  82. End Sub