> For the complete documentation index, see [llms.txt](https://book.ice-wzl.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.ice-wzl.xyz/windows-malware-development/processes-threads-handles/createprocess-example-basic.md).

# CreateProcess Example (Basic)

```
#include <windows.h>
#incluse <stdio.h>

int main(void){    
STARTUPINFOW si = { 0 };
PROCESS_INFORMATION pi = { 0 };

    if (!CreateProcessW(
        L"C:\\Windows\\System32\\mspaint.exe",
        NULL,
        NULL,
        FALSE,
        NORMAL_PRIORITY_CLASS,
        NULL,
        NULL,
        &si;
        &pi;  
    )){
        printf("(-) failed to create process, error: %ld", GetLastError());
        return EXIT_FAILURE;
    }
    printf("(+) process started! pid: %ld", pi.dwProcessId);
    return EXIT_SUCCESS;    //same as return 0;
}    
```
