If you are not familiar with underlying APIs, struct, and pointers, we do not recommend that you use APIs.
The AAuto Standard Library provides more stable and convenient methods to solve common programming problems. You should try your best to use standard library functions.
Import winex; // supports importing external window control Libraries
Import process; // import the external process control support library
Io. open () // open the Console
Process.exe cute ("notepad.exe") // run notepad
Var hwnd = winex. waitActive (, "Notepad"); // wait for Notepad to activate and obtain the handle
Var tid, pid = win. getThreadProcessId (hwnd); // obtain the thread ID
Var prcs = process (pid); // open the process
Var exePath = prcs. getPath ()
Io. print ("complete path of execution program obtained", exePath)
// Use the following code to list all DLL paths loaded by the program
For moduleEntry in prcs. eachModule (){
Io. print ("loading module path", moduleEntry. szExePath)
}
Other methods
Import process; import win; hwnd = 199492; // handle tid, pid = win. getThreadProcessId (hwnd); // obtain the process IDpath = process according to the handle. getPath (pid); // obtain the path win based on the process ID. msgbox (path, "AAuto ");