如何使用VB制作这样的程序

来源:百度知道 编辑:UC知道 时间:2024/05/18 06:16:06
我在我的U盘里放了很多实用的小工具,但每次都要进入U盘里一个个运行觉得太麻烦,所以我就用autorun.inf做个自动播放,但发现好像就只能一次打开一个程序,其它的只能放到右键菜单里去运行了,这样的话还是挺麻烦的,而且一大串菜单也不太好看。我就想要是做个小程序来,只要运行这个程序其它的软件都将以列表的方式体现在眼前!
而我就只有VB会点所以想来问问各位大虾这样的程序该怎么做?
其主要问题在于我不知道怎么让这个程序去打开其它程序
能不能具体点,用批处理的话看起来好像不太美观

给你做了一个 顺便我也练习了下
自己添加要加入的程序 双击或点启动执行 可以保存文件列表
比较简单 呵呵 原代码在下面 要是要打包的 发e-mail:yoya0303@163.com

from1 3个控件 command1 command2 list1
dialog.frm 4个 3个按钮 command1 command2 command3 和一个list1

Form1.frm 代码:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()
If List1.ListIndex <> -1 Then
List1_DblClick
End If
End Sub

Private Sub Command2_Click()
Dialog.Show
Form1.Hide
End Sub

Private Sub Form_Activate()
Dim x$
If FileExists(App.Path & "\config.ini") = True Then
Open App.Path & "\config.ini" For Input As #1
Do While Not EOF(1)
Line Input #1, x
List1.AddItem x
Loop
Close 1