MyProg.c 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. #include <windows.h>
  2. #include <commctrl.h>
  3. #if defined(_X86_)
  4. #define ARCHNOTE TEXT("\n\n(This EXE was compiled for the x86 architecture.)")
  5. #elif defined(_AMD64_)
  6. #define ARCHNOTE TEXT("\n\n(This EXE was compiled for the x64 architecture.)")
  7. #elif defined(_M_ARM64)
  8. #define ARCHNOTE TEXT("\n\n(This EXE was compiled for the Arm64 architecture.)")
  9. #else
  10. #error unknown arch
  11. #endif
  12. int WinMainCRTStartup(void)
  13. {
  14. // Work around bug in Windows XP Gold & SP1: If the application manifest
  15. // specifies COMCTL32.DLL version 6.0 (to enable visual styles), we must
  16. // call InitCommonControls() to ensure that we actually link to
  17. // COMCTL32.DLL, otherwise calls to MessageBox() fail. (XP SP2 appears
  18. // to fix this.)
  19. InitCommonControls();
  20. MessageBox(NULL, TEXT("Welcome to My Program.") ARCHNOTE,
  21. TEXT("Hello"), MB_OK);
  22. MessageBox(NULL, TEXT("Thank you for using My Program.\n\n")
  23. TEXT("(You can uninstall this by going to Add/Remove Programs in Control Panel.)"),
  24. TEXT("Goodbye"), MB_OK);
  25. ExitProcess(0);
  26. return 0;
  27. }