InterProcess

Int_ExecProgram, Int_ExecProgramWait, Int_ExecuteCommand, Int_ExecuteMacro, Int_FindDifferentApp

Int_ExecProgram

Description 

int Int_ExecProgram(
   char *Int_str1
);

This function executes another program specified by its name.

Parameters

char *Int_str1

A sequence of characters.

Return Values

int

If the function is successful, it returns TRUE (1), else FALSE (0).

// Int_ExecProgram example - LIM switch utility SW350.EXE will be called.
char            filename[256];
char            *ptr;
int             retval;
SetCommandText("Working...");            
Int_CreateTextWindow("API Example - Int_ExecProgram",0,RGB(0,0,128),RGB_WHITE,100);
Get_Filename(FILE_EXECUTABLE,filename);
ptr = strrchr(filename, '/');
if(ptr != NULL) *ptr = 0;    
else goto end;
strcat(filename, "/sw350.exe");
retval = ExistFile(filename);
if(retval == TRUE)
   Int_ExecProgram(filename);
else WaitText(0., "LIM Switch utility not found");
end:
Int_CloseTextWindow();

Note

If the program is already loaded, the function will set focus to this application. No more instances will be loaded.

Int_ExecProgramWait

Description 

 Int_ExecProgramWait(
   char *Int_str1
);

This function executes another program and waits until it finishes. See also Int_ExecProgram.

Parameters

char *Int_str1

A sequence of characters.

char txt[1000];
char ImageJ[260] = "$C:\Fiji.app\ImageJ-win32.exe$";
char ImageJmacro[260] = "$nis.ijm$";
strcat(txt, ImageJ);
strcat(txt, " -batch ");
strcat(txt, ImageJmacro);
StrExchangeChar(txt, 34, 36);
WaitText(0, txt);
Int_ExecProgramWait(txt);
WaitText(0, "DONE");   
Int_ExecuteCommand

Description 

int Int_ExecuteCommand(
   int  Int_AppId,
   char *Lp_Command
);

This function executes a command in a selected application.

Parameters

int Int_AppId

Application ID of instance that will run the command.

char *Lp_Command

Command to run.

Return Values

int

Returns the resulting code of the command.

See Also 
Int_ExecuteMacro, Int_FindDifferentApp

Int_ExecuteMacro

Description 

int Int_ExecuteMacro(
   int  Int_AppId,
   char *Lp_Macro
);

This function executes a macro in a selected application.

Parameters

int Int_AppId

Application ID of instance that will run the command.

char *Lp_Macro

Filename of the macro to be run. If it contains empty string, current macro is executed.

Return Values

int

Returns the resulting code of the macro.

See Also 
Int_ExecuteCommand, Int_FindDifferentApp

Int_FindDifferentApp

Description 

int Int_FindDifferentApp();

This function returns the application ID of another running instance of the same application.

Return Values

int

Returns the application ID code.

See Also 
Int_ExecuteMacro, Int_ExecuteCommand