Advertisement
Guest User

script

a guest
Mar 1st, 2015
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <d2d1.h>
  3. #include <d2d1_1.h>
  4.  
  5.  
  6. LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
  7. {
  8.     if(uMsg == WM_DESTROY){PostQuitMessage(0); return 0;}
  9. };
  10.  
  11.  
  12. int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPWSTR cmd, int nCmdShow)
  13. {
  14.     WNDCLASSEX windowclass;
  15.     ZeroMemory(&windowclass, sizeof(WNDCLASSEX));
  16.     windowclass.cbSize = sizeof(WNDCLASSEX);
  17.     windowclass.hbrBackground = (HBRUSH) COLOR_WINDOW;
  18.     windowclass.hInstance = hInstance;
  19.     windowclass.lpfnWndProc = WindowProc;
  20.     windowclass.lpszClassName = "MainWindow";
  21.     //windowclass.style = CS_HREDRAW | CS_VREDRAW;
  22.  
  23.     RegisterClassEx(&windowclass);
  24.     HWND windowhandle = CreateWindow("MainWindow", "Game window", WS_OVERLAPPEDWINDOW, 100, 100, 800, 600, NULL, NULL, hInstance, 0);
  25.  
  26.     if(!windowhandle) return -1;
  27.  
  28.     ShowWindow(windowhandle, nCmdShow);
  29.  
  30.     MSG message;
  31.     while(GetMessage(&message, NULL, 0 , 0))
  32.     {
  33.         DispatchMessage(&message);
  34.     }
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement