Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Samples

Start another application

A community discussion post from the original code:zIRON forum.

Colin admin
Posts
928
Threads
49
Location
Bulgaria

Start another application

This sample uses the CreateProcess api call to open notepad

compiled with Ziron 1.1.12.2

program WIN32GUI 'Sample';

//include simple memory manager - required for new, delete
#include 'smm32.zir';

//user32 holds win api functions of user32.dll
#include 'user32.zir';

//declare our struct variables
STARTUPINFOA spInfo;
PROCESS_INFORMATION prInfo;

//set spInfo.cb to the size of the struct
spInfo.cb = sizeof STARTUPINFOA;

//create process notepad.exe
CreateProcess(0, 'notepad.exe', 0, 0, 0, 0, 0, 0, @spInfo, @prInfo);

//close handles to the process
CloseHandle(prInfo.hProcess);
CloseHandle(prInfo.hThread);

//exit our application and notepad will stay open
ExitProcess(0);