|
-
Oct 6th, 2002, 01:14 PM
#1
Thread Starter
Frenzied Member
Easy question regarding Lists (Resolved!)
Hey..I have a ListBox with a bunch of paths to files in them, and what I want to do is have it cycle through the whole listbox and do something with each entry in the listbox...specifically, they are paths, and I want to run them with the Shell() function.
I'm not really proficient in VB (most of my postcounts are from the GenPC forum ) so if someone can clue me in on how to do this I'd appreciate it...
Last edited by JungleMan; Oct 6th, 2002 at 01:45 PM.
I'm bringing geeky back...
-
Oct 6th, 2002, 01:28 PM
#2
Well ...
Originally posted by Jungle-Man
...
I'm not really proficient in VB
No kidding!
VB Code:
Dim I As Integer, strPath As String
For I = 0 To List1.ListCount -1 Step 1
strPath = List1.List(I)
'Do Whatever You Want With strPath
Next I
.
-
Oct 6th, 2002, 01:31 PM
#3
PowerPoster
Is this wat you want:
VB Code:
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
Const SW_SHOWNORMAL = 1
Private Sub RunFile()
Dim intCounter As Integer
Dim intListCount As Integer
intListCount = List1.lictcount - 1
For intCounter = 0 To intListCount
ShellExecute Me.hwnd, vbNullString, List1.List(intCounter), vbNullString, "C:\", SW_SHOWNORMAL
Next
End Sub
-
Oct 6th, 2002, 01:44 PM
#4
Thread Starter
Frenzied Member
Thanks Honeybee...and you too amitabh but I didn't try your code, honeybee's worked 
Well I don't really program VB much. I am writing a benchmarking app (believe me, it is NOT as hard as it sounds! just generating and executing commands, and parsing a log file) for UT2003
I'm bringing geeky back...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|