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

📄 form1.frm

📁 本文件包含200个visual baisc实例
💻 FRM
字号:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Begin VB.Form Form1 
   Caption         =   "创建、删除桌面快捷方式"
   ClientHeight    =   4395
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5055
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   4395
   ScaleWidth      =   5055
   StartUpPosition =   1  '所有者中心
   Begin TabDlg.SSTab SSTab1 
      Height          =   4335
      Left            =   -15
      TabIndex        =   0
      Top             =   0
      Width           =   5025
      _ExtentX        =   8864
      _ExtentY        =   7646
      _Version        =   393216
      Tabs            =   2
      Tab             =   1
      TabsPerRow      =   2
      TabHeight       =   520
      ShowFocusRect   =   0   'False
      BackColor       =   8421504
      TabCaption(0)   =   "创建快捷方式"
      TabPicture(0)   =   "Form1.frx":000C
      Tab(0).ControlEnabled=   0   'False
      Tab(0).Control(0)=   "Command3"
      Tab(0).Control(0).Enabled=   0   'False
      Tab(0).Control(1)=   "Command1"
      Tab(0).Control(1).Enabled=   0   'False
      Tab(0).Control(2)=   "Drive1"
      Tab(0).Control(2).Enabled=   0   'False
      Tab(0).Control(3)=   "Dir1"
      Tab(0).Control(3).Enabled=   0   'False
      Tab(0).Control(4)=   "File1"
      Tab(0).Control(4).Enabled=   0   'False
      Tab(0).ControlCount=   5
      TabCaption(1)   =   "删除快捷方式"
      TabPicture(1)   =   "Form1.frx":0028
      Tab(1).ControlEnabled=   -1  'True
      Tab(1).Control(0)=   "File2"
      Tab(1).Control(0).Enabled=   0   'False
      Tab(1).Control(1)=   "Command2"
      Tab(1).Control(1).Enabled=   0   'False
      Tab(1).ControlCount=   2
      Begin VB.CommandButton Command2 
         Caption         =   "删除快捷方式"
         Height          =   450
         Left            =   3345
         TabIndex        =   7
         Top             =   3690
         Width           =   1485
      End
      Begin VB.FileListBox File2 
         Height          =   2790
         Hidden          =   -1  'True
         Left            =   255
         TabIndex        =   6
         Top             =   765
         Width           =   4590
      End
      Begin VB.CommandButton Command3 
         Caption         =   "退出"
         Height          =   450
         Left            =   -71775
         TabIndex        =   5
         Top             =   3540
         Width           =   1485
      End
      Begin VB.CommandButton Command1 
         Caption         =   "创建快捷方式"
         Height          =   450
         Left            =   -71775
         TabIndex        =   4
         Top             =   2880
         Width           =   1485
      End
      Begin VB.DriveListBox Drive1 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFFFFF&
         Height          =   300
         Left            =   -74865
         TabIndex        =   3
         Top             =   375
         Width           =   4395
      End
      Begin VB.DirListBox Dir1 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFFFFF&
         Height          =   1770
         Left            =   -74865
         TabIndex        =   2
         Top             =   735
         Width           =   4425
      End
      Begin VB.FileListBox File1 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFFFFF&
         Height          =   1470
         Left            =   -74880
         Pattern         =   "*.exe"
         TabIndex        =   1
         Top             =   2550
         Width           =   3015
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function fCreateShellLink Lib "Vb5stkit.dll" (ByVal lpstrFolderName As String, _
    ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, _
    ByVal lpstrLinkArgs As String) As Long
    
Private Declare Function OSfRemoveShellLink Lib "Vb5stkit.dll" Alias "fRemoveShellLink" _
    (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String) As Long
    
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" _
    (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Private Sub Form_Load()
  Dim b As String
  Dim p As Integer
  b = Space(260)
  p = GetWindowsDirectory(b, Len(b))
  winpath = Left(b, p)
  File2.Path = winpath & "\desktop"
End Sub

Private Sub Dir1_Change()
  File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
  On Error Resume Next
  Dir1.Path = Drive1.Drive
End Sub

Private Sub Command1_Click()  '在桌面上创建
  Dim mycreate As Long
  mycreate = fCreateShellLink("..\..\desktop", Left(File1.FileName, Len(File1.FileName) - 4), File1.Path & "\" & File1.FileName, "")
End Sub

Private Sub command2_click() '删除桌面上的快捷方式
  Dim mydel As Long
  mydel = OSfRemoveShellLink("..\..\desktop", Left(File1.FileName, Len(File1.FileName) - 4))
End Sub

Private Sub Command3_Click()
  End
End Sub


⌨️ 快捷键说明

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