Advertisement
Ed94

Nothing

May 15th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.30 KB | None | 0 0
  1.  
  2. /*Name: start_dreaming.cpp
  3.  *
  4.  * Author: Edawrd R. Gonzalez
  5.  * Created on May 10, 2014
  6.  *
  7.  * Notes:
  8.  * This is the initial file for launching. Currently only produces text in console. Eventually will create a window.
  9.  * Need to use the win32 api to create a window.
  10.  */
  11.  
  12.  
  13. #include <windows.h>
  14.  
  15.  
  16. //Preload
  17. LRESULT CALLBACK message_handler (HWND handle,UINT message,WPARAM wparam,LPARAM lparam); //Line 37
  18.  
  19.  
  20. int winmain()
  21.     {
  22.     WNDCLASSEX winclass;
  23.     messet(&winclass,0,sizeof(winclass));
  24.  
  25.     winclass.cbSize=sizeof(winclass);
  26.     winclass.lpfnWndProc=message_handler;
  27.     winclass.hCursor=LoadCursor(NULL,IDC_ARROW);
  28.     winclass.hInstance=GetModuleHand(e(NULL));
  29.     winclass.lpszClassName="Dreams of Vapor";
  30.     winclass.hbrBackground=(HBRUSH)(COLOR_WINDOW + 1);
  31.  
  32.     RegisterClassEX(&winclass);
  33.  
  34.     HWND win=CreateWindowEX(0,"Dreams of Vapor","Dreams of",WS_VISIBLE|WS_OVERLAPPEDWINDOW,100,100,640,480,NULL,NULL,GetModuleHandle(NULL),NULL);
  35.  
  36.     while(GetMessage(&message,NULL,0,0)>0)
  37.         {
  38.         TranslateMessage(&message);
  39.         DispatchMessage(&message);
  40.         }
  41.     return message.wParam;
  42.     }
  43.  
  44.  
  45. LRESULT CALLBACK message_handler (HWND handle,UINT message,WPARAM wparam,LPARAM lparam)
  46.     {
  47.     switch(message)
  48.         {
  49.         case WM_CLOSE:
  50.         PostQuitMessage(0);
  51.         break;
  52.         }
  53.     return DefWindowProc(handle,message,wpram,lparam);
  54.  
  55.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement