Register | Login
Forum Index > Samples > Start another application
Author Message
Pages: 1
Admin
Site Admin

avatar

(send private message)

Posts: 923
Topics: 54

Location:
OverHertz Studio
[31] Start another application - posted: 2011-05-12 15:48:03
This sample uses the CreateProcess api call to open notepad

compiled with Ziron 1.1.12.2

Code:
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);


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 1 user(s) online. 0 member(s) and 1 guest(s)
Most users ever online was 533, May 5, 2016, 7:19 am.


Statistics:
Threads: 223 | Posts: 1835 | Members: 49 | Active Members: 49
Welcome to our newest member, pierrotstudio
const Copyright = '2011-2017 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd