fork download
  1. #include <iostream>
  2. #include <windows.h>
  3.  
  4. using namespace std;
  5.  
  6. LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);
  7.  
  8. int WINAPI WinMain(HINSTANCE HInst , HINSTANCE hPrevInst, LPSTR args, int ncmdshow )
  9. {
  10. WNDCLASSW wc = {0};
  11.  
  12. wc.hbrBackground = {HBRUSH}COLOR_WINDOW;
  13. wc.hCursor = LoadCursor(NULL,IDC_ARROW);
  14. wc.hInstance = hInst;
  15. wc.lpszClassName = L"myWindowClass";
  16. wc.lpfnWndProc = WindowProcedure;
  17.  
  18. if (RegisterClassW(&wc))
  19. return -1;
  20.  
  21. CreateWindowW(L"myWindowClass", L"My Window",WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100,100,500,500,NULL,NULL,NULL,NULL);
  22.  
  23. MSG msg = (0);
  24.  
  25. while (GetMessage(&msg),NULL,NULL,NULL){
  26. TranslateMessage (&msg);
  27. DispatchMessage(&msg);
  28. }
  29.  
  30.  
  31.  
  32. return 0;
  33. }
  34.  
  35. LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
  36. {
  37. switch (msg)
  38. {
  39. case WM_DESTROY:
  40. PostQuitMessage(0);
  41. break;
  42. default:
  43. DefWindowProcW(hWnd,msg,wp,lp);
  44.  
  45. }
  46.  
  47.  
  48.  
  49. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:10: fatal error: windows.h: No such file or directory
 #include <windows.h>
          ^~~~~~~~~~~
compilation terminated.
stdout
Standard output is empty