⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmnewentry.frm

📁 高级卸载工具
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmNewEntry 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "新建程序"
   ClientHeight    =   4350
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7350
   ForeColor       =   &H00FFFFFF&
   Icon            =   "FrmNewEntry.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4350
   ScaleWidth      =   7350
   StartUpPosition =   1  '所有者中心
   Begin Add_Remove_Platinum_2004.CommandButton CmdOk 
      Height          =   495
      Left            =   5520
      TabIndex        =   8
      Top             =   3720
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   873
      Caption         =   "确定"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin Add_Remove_Platinum_2004.CommandButton CmdCancel 
      Height          =   495
      Left            =   3720
      TabIndex        =   7
      Top             =   3720
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   873
      Caption         =   "取消"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.TextBox TxtUninstallString 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   240
      TabIndex        =   2
      Top             =   3120
      Width           =   6855
   End
   Begin VB.TextBox TxtDiplayName 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   240
      TabIndex        =   1
      Top             =   2160
      Width           =   6855
   End
   Begin VB.TextBox TxtRegName 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   240
      TabIndex        =   0
      Top             =   1200
      Width           =   6855
   End
   Begin VB.Label lblNew 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "New Program"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   330
      TabIndex        =   6
      Top             =   285
      Width           =   6690
   End
   Begin VB.Line Line1 
      Index           =   0
      X1              =   120
      X2              =   120
      Y1              =   480
      Y2              =   3600
   End
   Begin VB.Line Line2 
      X1              =   120
      X2              =   7200
      Y1              =   3600
      Y2              =   3600
   End
   Begin VB.Line Line1 
      Index           =   1
      X1              =   7200
      X2              =   7200
      Y1              =   480
      Y2              =   3600
   End
   Begin VB.Label LblRegName 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "注册项目名称 :"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Left            =   240
      TabIndex        =   5
      Top             =   840
      Width           =   1380
   End
   Begin VB.Label LblUninstallString 
      BackStyle       =   0  'Transparent
      Caption         =   "卸载命令 :"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   255
      Left            =   240
      TabIndex        =   4
      Top             =   2760
      Width           =   2295
   End
   Begin VB.Label LblDiplayName 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "程序名称 :"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   240
      Left            =   240
      TabIndex        =   3
      Top             =   1800
      Width           =   855
   End
   Begin VB.Shape Shape2 
      FillColor       =   &H00E0E0E0&
      FillStyle       =   0  'Solid
      Height          =   615
      Index           =   1
      Left            =   120
      Shape           =   4  'Rounded Rectangle
      Top             =   120
      Width           =   7095
   End
End
Attribute VB_Name = "FrmNewEntry"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'★★★★★****************************★★★★★**********************★★★★★
'金诺VB园-收藏整理
'本站是专注于VB和VBNET编程的源码下载站
'发布日期:2008-3-14 22:00:47
'网    站:http://www.vbget.com/          (金诺VB园)
'网    站:http://www.vbget.com/daohan/   (VB编程网址导航)
'E-Mail  :vbget@yahoo.cn
'QQ      :158676144
'源码作者:如果您有VB商业源码需要获得收益,本站将有VIP收费下载频道可供你发布!
'         您有权定价;改价;删除;及即时查看下载量(即收益),所有收益全部归您!
'         本站将在双方协商的一个金额周期内打款到作者帐户中,您只需负责打款费用!
'         本站只作为一个平台提供最新VB源码咨讯和源码下载!
'本注释由<站长工具之智能注释>软件自动添加!金诺VB园有此软件下载!
'★★★★★****************************★★★★★**********************★★★★★


Option Explicit

Private Sub Form_Load()
    Me.Icon = FrmMain.Icon
End Sub

'=========================================================================
' Close upon cancel button click
'=========================================================================
Private Sub cmdCancel_Click()
    Unload Me
End Sub

'=========================================================================
' Create the entries after validating the user input
'=========================================================================
Private Sub cmdOk_Click()
On Error GoTo errHandle:
    Dim i As Integer
    
    TxtDiplayName.Text = Trim$(TxtDiplayName.Text)
    TxtRegname.Text = Trim$(TxtRegname.Text)
    TxtUninstallString.Text = Trim$(TxtUninstallString.Text)
    
    'Check if user has enter values for the essential keys
    If LenB(TxtRegname.Text) = 0 And LenB(TxtDiplayName.Text) = 0 And LenB(TxtUninstallString.Text) = 0 Then
        Unload Me
        Exit Sub
    End If
    
    If LenB(TxtRegname.Text) = 0 Then
        MsgBox "Please Enter a value for the Registry Entry Name", vbInformation, App.Title
        TxtRegname.SetFocus
        Exit Sub
    End If
    
    If LenB(TxtDiplayName.Text) = 0 Then
        MsgBox "Please enter a value for the Display Name ", vbInformation, App.Title
        TxtDiplayName.SetFocus
        Exit Sub
    End If

    If LenB(TxtUninstallString.Text) = 0 Then
        MsgBox "Please enter a value for the uninstall String", vbInformation, App.Title
        TxtUninstallString.SetFocus
        Exit Sub
    End If
    'Check if the key already exists. Otherwise regitry will raise an error
    For i = 1 To FrmMain.lstview.ListItems.Count
        If StrComp(FrmMain.lstview.ListItems(i), TxtRegname.Text, vbTextCompare) = 0 Then
            MsgBox "This key name already exist in the list. Please enter another key name.", vbInformation, App.Title
            TxtRegname.SelStart = 0
            TxtRegname.SelLength = Len(TxtRegname.Text)
            TxtRegname.SetFocus
            Exit Sub
        End If
    Next
    
    ' Create the keys into the registry
    Call SaveString(HKEY_LOCAL_MACHINE, UnInstallPath & TxtRegname.Text, "DisplayName", TxtDiplayName.Text & vbNullChar)
    Call SaveString(HKEY_LOCAL_MACHINE, UnInstallPath & TxtRegname.Text, "UninstallString", TxtUninstallString.Text & vbNullChar)

    ' Refresh the main forms installed programs list to reflect the newly added program
    FrmMain.mnu_refresh_Click
    
    ' Close the form
    Unload Me
    Exit Sub
errHandle:
    MsgBox "Error occurred New Entry Ok: " & vbCrLf & Err.Description, vbCritical, App.Title
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -