Home > Back-end >  EXE between parametric open issues, methods and code, thank you!
EXE between parametric open issues, methods and code, thank you!

Time:10-21

I have an EXE: A and an EXE: B

Unable to open 1, using A common way,

2, must use the B to open A program, such as using the statement
ShellExecute (handle, the 'open', 'c: \ a.e xe - PASS' , '-s',' ', SW_SHOWNORMAL);

Have agreed with similar parameters to open,

Could you tell me how to write ah, should I still had 25 points and contribution! O code

CodePudding user response:

A project file, add the
The begin
If ParamStr (1) & lt;> 'PASS' then ExitProcess (0);



When call
ShellExecute (handle, the 'open', 'c: \ a.e xe PASS', ', ' ', SW_SHOWNORMAL);
Can be

CodePudding user response:

The original poster is hidden from the user operation parameters reach the purpose of don't allow the user to run the program running,
The building seems to have two parameters, a - pass - s, write A program plus checker when creating or initialization parameter
If (UpCase (ParamStr (1) & lt;> '- PASS')) and (UpCase (ParamStr (2) & lt;> '-s')) then ExitProcess (0);
This runtime respectively take - not pass is the program and the -s parameter refused to run,
In procedure call event B plus
ShellExecute (handle, the 'open', 'c: \ a.e xe - PASS', '-s',' ', SW_SHOWNORMAL);
Actually you can literally define A procedure parameters, as long as the wrong user open these parameters, the user will not be able to run it, only through your program to run it,


CodePudding user response:

Still use FindCmdLineSwitch, ha ha,

CodePudding user response:

A few days ago just use this, pay attention to, with 2 or 3 floor said

CodePudding user response:

reference 1st floor kiboisme response:
A project file, add the
The begin
If ParamStr (1) & lt;> 'PASS' then ExitProcess (0);



When call
ShellExecute (handle, the 'open', 'c: \ a.e xe PASS', ', ' ', SW_SHOWNORMAL);
Can


The code in the form initialization or *. DPR file.
Seem to open it,

CodePudding user response:

It in the DPR
.
  • Related