can any one help me

hy every body
i develop a program that first open a file than i want that opened file to run (that file is an audio file that run on windows media player or any suitable program) i use the command

WinExec("complete path of windows media player", sw_show);

this command call the windows media player but still when it run need to enter the file name another time
is this any solution to use the filename that is openned already without retyping again
please can anyone help me
many thanks in advance
regards
rania

Comments

  • : hy every body
    : i develop a program that first open a file than i want that opened file to run (that file is an audio file that run on windows media player or any suitable program) i use the command
    :
    : WinExec("complete path of windows media player", sw_show);
    :

    I think you should also pass the name of the media file to WinExec, like this:

    [code]
    WinExec("c:windowswmplayer.exe filename.wav", sw_show);
    [/code]

    Hope this helps
    nICO

    [hr]
    [italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
    JOHN KEATS


  • well many thanks for your help
    but that represent a special case(taking into consideration that filename is variable) any time i change the file name i have to edit in the the program and i have to open many file(i have not know their path when i edit the program )so is their a command to open generally without knowing the file name (in program.dsw)and work with [filename] as a variable representing the complete path of the file

    char filename[50];
    WinExec(e:\windowsmedia.exe filename,sw_show);

    please if you get it tell me.
    many thanks again
    rania
  • That's not a problem!
    You have 2 ways to do this:

    1) pass the filename to your program's command line (exactly what you do with Media Player command line...) and then you can read it in the lpCommanLine parameter of WinMain

    2) Implement an "Open File" dialog box with the GetOpenFileName command. Check for Common Dialog boxes on MSDN to find more about this.

    Hope this helps
    nICO

    [hr]
    [italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
    JOHN KEATS


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories