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

avatar

(send private message)

Posts: 933
Topics: 55

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 6 user(s) online. 0 member(s) and 6 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd