fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. #include <windows.h>
  5. #include <tlhelp32.h>
  6.  
  7. int main(int argc, char* argv[])
  8. {
  9. HANDLE snapshot = ::CreateToolhelp32Snapshot(
  10. TH32CS_SNAPMODULE, 0);
  11.  
  12. if (snapshot != INVALID_HANDLE_VALUE)
  13. {
  14. MODULEENTRY32 me32{};
  15. me32.dwSize = sizeof(MODULEENTRY32);
  16. if (::Module32First(snapshot, &me32))
  17. {
  18. do
  19. {
  20. std::wcout << me32.szExePath << std::endl;
  21. } while (::Module32Next(snapshot, &me32));
  22. }
  23.  
  24. ::CloseHandle(snapshot);
  25. }
  26.  
  27. return EXIT_SUCCESS;
  28. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:21: fatal error: windows.h: No such file or directory
compilation terminated.
stdout
Standard output is empty