I'd like to know how to execute a file (.exe) from a menubar.
Is there something like :

.if wParam == 1100
invoke ..., Any.exe ,...

I've tried the CreateProcess call but I can't get it to compile
correctly.

Thanks for any help and try to excuse my Newbie Questions,

Errno
Posted on 2001-10-17 07:16:33 by Errno
You can use ShellExecute to do that.:alright:
Posted on 2001-10-17 07:53:43 by gscundiff
You can also use WinExec API.
Very easy to use! :cool:
Posted on 2001-10-17 13:18:43 by HihrinJa
WinExec() is an old Win16 API and you would be better off using ShellExecute().
Posted on 2001-10-17 13:29:44 by comrade
CreateProcess will solve your problem and has the advantage that you don't have to link the shell32.lib to your program.


stinfo db STARTUPINFO<>
pinfo db PROCESS_INFORMATION<>

fullPath db "C:\windows\notepad.exe",0
commandline db "THIS IS THE COMMAND LINE TO PASS TO THE PROGRAM",0

invoke CreateProcess, ADDR fullPath, ADDR commandline, NULL, NULL, NULL, DETACHED_PROCESS, NULL, NULL, ADDR stinfo, ADDR pinfo

invoke CloseHandle, pinfo.hThread
invoke CloseHandle, pinfo.hProcess

THat will do it :):alright:
Posted on 2001-10-17 23:22:26 by magicmac
First I'd like to thank all who replied to the above message!
The Problem seems to be solved. ShellExecute compiled well
but it didn't work the expected way. CreateProcess works
fine now.

Errno
Posted on 2001-10-18 01:21:32 by Errno