我想用VB制作一个XP下的文件夹自定义工具,但是出了点问题

来源:百度知道 编辑:UC知道 时间:2024/05/22 12:27:11
我用VB自己做了一个XP下的文件夹字定义程序,文件夹自定义是这样的:生成desktop.INI文件的程序,里面有:
[{BE098140-A513-11D0-A3A4-00C04FD706EC}]
IconArea_Image=D:\My Documents\My Pictures\CLANNAD\壁纸\44462.jpg
IconArea_Text=0x00FF0000
比如这样的代码,现在想用VB自己写,但是遇到了一些问题:下面是我的代码:
Dim color As String, lujing As String
Dim sFile As String

Private Sub Check1_Click()
If Check1.Value = 1 Then
Text1.Enabled = True
Else
Text1.Enabled = False
End If
End Sub

Private Sub Check2_Click()
If Check2.Value = 1 Then
Text2.Enabled = True
Else
Text2.Enabled = False
End If
End Sub

Private Sub Command1_Click()

With CommonDialog1
.DialogTitle = "打开"
.CancelError = False
'ToDo: 设置 common dialog 控件的标志和属性
.Filter = "文件 (*.jpg;*.bmp;*.gif)|*.jpg;*.bmp;*.gif"
.ShowOpen
If Len(.FileName) = 0 Then
E

建议你使用INI处理函数
会更加方便和安全
'模块代码
'==================================================
'Ini操作声明
'==================================================
Dim Ret As Long
Dim Start As Long
Public FileName As String
Public MaxthonPath As String
Public TimeID As Integer
Const BufSize = 10240
Dim buf As String * BufSize
Private Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileSection Lib "kernel32" Alias "GetPrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApp