#include <core>
#include <string>
#include <ShellExecute>
static stock ToCharString(s[], size = sizeof(s))
{
for (new i = 0; i < size; i++) {
s[i] = swapchars(s[i]);
}
}
main()
{
new File[] = !"notepad.exe";
new Operation[] = !"open";
new Parameters[] = !"server.cfg";
ToCharString(File);
ToCharString(Operation);
ToCharString(Parameters);
new result = ShellExecute(Operation, File, Parameters, SW_SHOW); // crach here
printf("ShellExecute() returned %d", result);
}
compiler: https://github.com/pawn-lang/compiler (build in mvs2017)
all build: https://mega.nz/#!sqgSBSjS!C173OJx634UwDaIQpZyoh79KX1-UxAzSYyZmeWZWlQE
use ShellExecute-test.pwn
compiler command "pawncc.exe ShellExecute-test.pwn -d3"