| |

VerySource

 Forgot password?
 Register
Search
View: 630|Reply: 2

Urgent! Can you ask the API calling exe application problem?

[Copy link]

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-3-5 19:00:01
| Show all posts |Read mode
[System.Runtime.InteropServices.DllImport ("kernel32.dll")]
private static extern bool TerminateProcess (IntPtr hProcess, int uExitCode);
[System.Runtime.InteropServices.DllImport ("kernel32.dll")]
private static extern IntPtr GetCurrentProcess ();

__________________________________

Above is the API to close the application.

Excuse me, what is the API function to open the specified EXE file?

Can you give the code ...
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-6-12 11:45:02
| Show all posts
[DllImport("advapi32")] public static extern int CreateProcessAsUser(HANDLE hToken, string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes, int bInheritHandles, int dwCreationFlags, string dlpCreation, lp );

[DllImport("kernel32")] public static extern int CreateProcess(string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes, int bInheritHandInfo, int dwCreationFlags, IntPtr lpEnvirment, IntPtr lpEnvirment

[DllImport("kernel32")] public static extern int CreateThread(ref SECURITY_ATTRIBUTES lpThreadAttributes, int dwStackSize, ref int lpStartAddress, IntPtr lpParameter, int dwCreationFlags, ref int lpThreadId);
Reply

Use magic Report

0

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-6-18 22:15:01
| Show all posts
System.Diagnostics.Process pro = new System.Diagnostics.Process();

pro.StartInfo.FileName = @"C:\WINDOWS\System32\calc.exe";
pro.StartInfo.Arguments="";
pro.Start();
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list