Source.c 442 B

123456789101112131415161718
  1. #include <stdio.h>
  2. #include <Windows.h>
  3. int main() {
  4. OPENFILENAME ofn;
  5. char szFile[256];
  6. ZeroMemory(&ofn, sizeof(ofn));
  7. ofn.lStructSize = sizeof(ofn);
  8. ofn.lpstrFile = szFile;
  9. ofn.nMaxFile = sizeof(szFile);
  10. GetOpenFileName(&ofn);
  11. STARTUPINFO si;
  12. PROCESS_INFORMATION pi;
  13. ZeroMemory(&si, sizeof(si));
  14. ZeroMemory(&pi, sizeof(pi));
  15. CreateProcess(NULL, szFile, NULL, NULL, NULL, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi);
  16. return 0;
  17. }