Následující úryvek kódu spustí aplikaci calc.exe pomocí WinAPI funkce CreateProcess.

#include <windows.h>
#include <stdio.h>
 
int main(int argc, char *argv[]){
  char full_path[MAX_PATH];
  STARTUPINFOA si;
  PROCESS_INFORMATION pi;
 
  GetSystemDirectoryA(full_path, MAX_PATH);
  strcat(full_path, "\\calc.exe");
 
  ZeroMemory(&si, sizeof(si));
  si.cb = sizeof(si);
 
  ZeroMemory(&pi, sizeof(pi));
 
  if(CreateProcessA(full_path, NULL, NULL, 
                    NULL, NULL, false, 
                    NULL, NULL, &si, &pi) == 0){
    printf("Error: CreateProcess\n");
    return 1;
  }
 
  printf("New process was created:\ncalc.exe\n");
 
  CloseHandle(pi.hThread);
  CloseHandle(pi.hProcess);
 
  printf("Press enter...");
  getchar();
 
  return 0;
}