Link to home
Start Free TrialLog in
Avatar of bahamo
bahamo

asked on

open wave file with cool edit from vb program

hi every body
am useing visuall basic 6 to open and play wave files
with mmcontrol and mcisendstring
instead of opening the wave file with mmcontrol ineed to use cool edit i just want my users to provide the path of the wave file and automaticly open with cool edit which installed in my computer
thank inadvance
Avatar of Mark_FreeSoftware
Mark_FreeSoftware
Flag of Netherlands image


have you tried this:

shell """c:\path\to\cooledit.wav"" ""c:\path\to\wave.wav"""
Avatar of bahamo
bahamo

ASKER

yes that one is working good but the problem is that iwant my user to provide the path useing atext box and itry the code below and it doesnot work:

dim pathfile as string
pathfile=text1.text
shell """c:\path\to\cooledit.wav"" "" pathfile"""
also is it possible to drag and drop the audio file from visuall basic from to apllication like cooledit
U can get input in ur text box from user
then use shellexecute to invoke cooledit exe.

Public 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

Dim lngErr As Long
pathfile = text1.text

lngErr = ShellExecute(0, "OPEN", pathfile, "", "", 0)
\\chk value of IngErr if it is 0 ten it is successfully invoked...



ASKER CERTIFIED SOLUTION
Avatar of Mark_FreeSoftware
Mark_FreeSoftware
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bahamo

ASKER

thank for reply
conncerinig the reply from kaliyugkaarjun , i understand that
pathfile is the path of the udio file it self ,what i dont understand where is the path of my cooledit ?
imean where to write the full path in the shellexecute
thank in advance

that is not neccesarily if cooledit is the default program to open wav files

else it won't work
Mark_FreeSoftware  is right...

If u specify lpFile as an executable file then lpParameters will e parameter to be passed to that file.

So try this ,

Public 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

Dim lngErr As Long
Program = c:\cooledit.exe // path of cooledit executable
pathfile = text1.text

lngErr = ShellExecute(0, "OPEN", Pragram, pathfile, "", SW_SHOWNORMAL)