Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ShellExecute

Status
Not open for further replies.

speek

Technical User
Joined
Mar 29, 2008
Messages
25
Location
US
I've made a frontend for a MP3 encoder (executetable console program). Until now the frontend created and launched a batch file. The downside of batch files is that it doesn't work if the filenames of the files that must be encoded contain accented characters. So now I want to use the ShellExecute function. But I cannot get it to work like I want. This is the code I use now:

------------------------------

Private Sub cmdEncode_Click()

For i = 1 To lvMp3.ListItems.Count
Set lst = lvMp3.ListItems.Item(i)

Command = fileOld & Chr(32) & fileNew & Chr(32) & cmbPreset.Text

ShellExecute Me.hwnd, "Open", App.Path & "\mppenc.exe", Command, "", 1

Next i

End Sub

-------------------------------

But despite the For Next command all files on the list are processed (encoded) at the same time. I want them to be processed one at a time and also in the same DOS-box.

Anyone has a suggestion for me? Thanks.

Wim Speekenbrink
 
what you need is for the program to wait for one shellexecute to finish before starting the next one.
Check out this web page for some info on how to do this:

good luck
hope this helps

:-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top