|
|||
|
Hi
Is is possible to change my working directory ? Before I launch an external application I want to set working directory to where the external application locates. The external application has its assets in its directory. If I don't change working directory ,the app I launched can't load its assets. Thank you ![]() |
|
|||
|
Yes, by using the Windows API ShellExecute, as shown in the following code
Code:
dllimport "shell32.dll" stdcall long ShellExecuteA(long, String, String, String, String, int) as shExec;
shExec(getMainWnd().handle, // handle of the main window
"open", // operation verb
getAdditionalFile("my.exe"), // external application to run
"1.txt", // parameter
"c:\\temp", // work directory
/*SW_SHOW*/5);
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|