Re: Invissible DOS-BOX ?
- Posted by Derek Parnell <dparnell at BIGPOND.NET.AU> Nov 22, 2000
- 358 views
As an alternative, you can use a Win32lib routine. shellExecuteEx("open", <program name>, <command line parameters>, 0, SW_SHOWDEFAULT, 0) ------ Derek Parnell Melbourne, Australia (Vote [1] The Cheshire Cat for Internet Mascot) > Here it is, with an example of how to use it below it: > (the "funny" names were chosen just to try to eliminate possiblity of > conflicts > with any other routines) > -------------------------------------------------------------------------- > -- STUFF ADDED TO ALLOW RUNNING OTHER PROGRAMS: > -- (wraps ShellExecute fully, provided by Wolfgang Fritz): > > -- originally from DaJaRo jumpto.ew > atom lib > integer jJumpto --id > if platform() = WIN32 then > lib = open_dll("shell32.dll") > jJumpto = define_c_func(lib,"ShellExecuteA", > {C_INT,C_POINTER,C_POINTER,C_POINTER,C_POINTER,C_INT},C_INT) > if jJumpto = -1 then > puts(1,"couldn't find ShellExecuteA\n") > abort(1) > end if > end if > > procedure zJump_to(integer id,sequence filename, > sequence defaultpath,sequence parameters, integer flag) > sequence command, Filenam, DefaultPath, Parameters > integer Nop > atom command_ptr,Fnm_ptr,Prm_ptr,Dfp_ptr,hw > command = "Open" > Filenam= filename > Parameters=parameters > DefaultPath=defaultpath > command_ptr = allocate_string(command) > Fnm_ptr = allocate_string(Filenam) > Prm_ptr = allocate_string(Parameters) > Dfp_ptr = allocate_string(DefaultPath) > hw= getHandle(id ) > Nop=c_func(jJumpto,{hw,command_ptr, > Fnm_ptr,Prm_ptr,Dfp_ptr,flag}) > free(command_ptr) > free(Fnm_ptr) > free(Prm_ptr) > free(Dfp_ptr) > end procedure > ---------------------------------------------------------- > -- example of using above: > zJump_to( > -- passing your "calling" window's id: > Window1,-- window jumping from (?) > -- with the program to call: > "exw.exe", > -- in the current directory (or any other directory you want to > specify): > current_dir(), > -- the parameter to pass to exw.exe to run: > "ide.exw", > -- and last, the 'show' parameter: > SW_SHOWDEFAULT ) > -- or some other show paramters, like SW_SHOWMAXIMIZED >