fork download
  1. #include <stdio.h>
  2. #include <windows.h>
  3. #include <shellapi.h>
  4.  
  5. int main(void)
  6. {
  7. const wchar_t* name = L"gt.exe";
  8. wchar_t path[300];
  9. wchar_t res[300];
  10.  
  11. GetModuleFileNameW(NULL, path, 300);
  12.  
  13. wcsncat(res, name, wcslen(name));
  14. wcsncat(res, L" ", 1);
  15. wcsncat(res, path, wcslen(path));
  16.  
  17. STARTUPINFO si;
  18. PROCESS_INFORMATION pi;
  19. memset(&si, 0, sizeof(si));
  20.  
  21. if(!CreateProcessW( NULL, res, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ))
  22. {
  23. printf("Error code:%i", GetLastError());
  24. }
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:21: fatal error: windows.h: No such file or directory
 #include <windows.h>
                     ^
compilation terminated.
stdout
Standard output is empty