扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者: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" |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。