공부(Study)

First Win32 Project

Jae Ryun, Buster, Chung 2017. 2. 15. 14:04

#include <Windows.h>

#include <tchar.h>


int WINAPI  WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR Ipcmdline, int nCmdShow)

{

MessageBox(NULL, _T("Hello World"), _T("메시지"), MB_OK);

//Null, 내용, 제목표시줄, 몰라

return 0;

}



this code will create window below:




So, There are WinMain() and WndProc() Functions


 WinMain( )
{
       윈도우 클래스 만들기 - (RegisterClass(...))

       윈도우 객체 생성하기 - (CreateWindow(...))

       윈도우 객체 화면에 띄우기 - (ShowWindow(...))

       메시지 루프 돌리기 - While(GetMessage(....))
}

 

WndProc( )
{
       전달된 메시지 처리하기
}


WinMain() function only create Window of program

WndProc() function manages Window messages



From: http://yyman.tistory.com/