Main.c 505 B

1234567891011121314151617181920212223
  1. #include <Windows.h>
  2. #include <stdio.h>
  3. int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  4. {
  5. OPENFILENAME ofn;
  6. WCHAR szFile[260] = { 0 };
  7. ZeroMemory(&ofn, sizeof(ofn));
  8. ofn.lStructSize = sizeof(ofn);
  9. ofn.lpstrFile = szFile;
  10. ofn.nMaxFile = sizeof(szFile);
  11. ofn.lpstrFilter = L"ALL\0*.*\0exe\0*.EXE\0";
  12. ofn.nFilterIndex = 1;
  13. ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
  14. if (GetOpenFileNameW(&ofn) == TRUE)
  15. {
  16. _wsystem(ofn.lpstrFile);
  17. }
  18. }