扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:40Star 来源:blog 2007年10月14日
关键字: 文件夹图标 个性化 Visual Basic
[.ShellClassInfo] ConfirmFileOp=0 InfoTip=我自己的文件夹 IconIndex=0 IconFile=MyFolder.ico |
attrib +s i:\MyFolder |
Option Explicit Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long Private Declare Function PathMakeSystemFolder Lib "shlwapi.dll" Alias "PathMakeSystemFolderA" (ByVal pszPath As String) As Long Private Sub Form_Load() '以下几步用于创建Desktop.ini文件 '不存在ini文件时,会自己创建ini WritePrivateProfileString ".ShellClassInfo", "ConfirmFileOp", "0", App.Path & "\desktop.ini" WritePrivateProfileString ".ShellClassInfo", "InfoTip", "我的文件夹因此而改变", App.Path & "\desktop.ini" WritePrivateProfileString ".ShellClassInfo", "IconIndex", "0", App.Path & "\desktop.ini" WritePrivateProfileString ".ShellClassInfo", "IconFile", "MyFolder.ico", App.Path & "\desktop.ini" '让文件夹成为系统文件夹 PathMakeSystemFolder App.Path End Sub |
WritePrivateProfileString ".ShellClassInfo", "IconFile", "MyFolder.ico", App.Path & "\desktop.ini" |
WritePrivateProfileString ".ShellClassInfo", "IconFile", App.EXEName & ".exe", App.Path & "\desktop.ini" |
濡傛灉鎮ㄩ潪甯歌揩鍒囩殑鎯充簡瑙T棰嗗煙鏈€鏂颁骇鍝佷笌鎶€鏈俊鎭紝閭d箞璁㈤槄鑷抽《缃戞妧鏈偖浠跺皢鏄偍鐨勬渶浣抽€斿緞涔嬩竴銆�