Are there example codes of how I can run executables and com files with args passed to them from within HLA?
The shellexecute function should do the trick :) Here's an example the runs notepad with the hla source file as the commandline parameter.
program shellexdemo;
#include ("stdlib.hhf")
#include ("w.hhf")
#asm
includelib \masm32\lib\shell32.lib
#endasm
static
ShellExecute : Procedure
(
hwnd : DWORD;
lpOperation : string;
lpFile : string;
lpParameters : string;
lpDirectory : string;
nShowCmd : DWORD
);
@stdcall;
returns( "eax" );
external( "__imp__ShellExecuteA@24");
begin shellexdemo;
ShellExecute
(
0,"OPEN","notepad.exe",
"shellex.hla","",
w.SW_SHOWNORMAL
);
end shellexdemo;
The "HowLong.HLA" program in the HLA Examples download demonstrates one way to do this.
Someday, I'll have to add a "system" call to the HLA standard library to trivialize this process.
Cheers,
Randy Hyde
Someday, I'll have to add a "system" call to the HLA standard library to trivialize this process.
Cheers,
Randy Hyde
Great! Thanks for the demos.