Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Name: start_dreaming.cpp
- *
- * Author: Edawrd R. Gonzalez
- * Created on May 10, 2014
- *
- * Notes:
- * This is the initial file for launching. Currently only produces text in console. Eventually will create a window.
- * Need to use the win32 api to create a window.
- */
- #include <windows.h>
- //Preload
- LRESULT CALLBACK message_handler (HWND handle,UINT message,WPARAM wparam,LPARAM lparam); //Line 37
- int winmain()
- {
- WNDCLASSEX winclass;
- messet(&winclass,0,sizeof(winclass));
- winclass.cbSize=sizeof(winclass);
- winclass.lpfnWndProc=message_handler;
- winclass.hCursor=LoadCursor(NULL,IDC_ARROW);
- winclass.hInstance=GetModuleHand(e(NULL));
- winclass.lpszClassName="Dreams of Vapor";
- winclass.hbrBackground=(HBRUSH)(COLOR_WINDOW + 1);
- RegisterClassEX(&winclass);
- HWND win=CreateWindowEX(0,"Dreams of Vapor","Dreams of",WS_VISIBLE|WS_OVERLAPPEDWINDOW,100,100,640,480,NULL,NULL,GetModuleHandle(NULL),NULL);
- while(GetMessage(&message,NULL,0,0)>0)
- {
- TranslateMessage(&message);
- DispatchMessage(&message);
- }
- return message.wParam;
- }
- LRESULT CALLBACK message_handler (HWND handle,UINT message,WPARAM wparam,LPARAM lparam)
- {
- switch(message)
- {
- case WM_CLOSE:
- PostQuitMessage(0);
- break;
- }
- return DefWindowProc(handle,message,wpram,lparam);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement