#include <windows.h>
#include <tchar.h>
int _tWinMain()
{
return 0;
}
#include <windows.h>
: 데이터 타입, 함수 원형, 매크로 상수 등을 정의한다.
#include <tchar.h>
: 범용 타입을 사용하기 위한 헤더
⑴ WinMain - 유니코드 X
⑵ wWinMain - 유니코드 O
⑶ _tWinMain - 매크로, 범용적 형태
int _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lp, int nshow)
{
return 0;
}
⑴ hInstance - 프로그램의 인스턴스 핸들
⑵ hPrev - 바로 앞에 실행된 현재 프로그램의 인스턴스 핸들 (없을 경우 NULL)
⑶ IpCmdLine 명령행으로 입력된 프로그램 인자
⑷ nShowCmd - 프로그램이 실행될 형태 (최소화, 보통, 최대화 모양 등이 전달됨)
MessageBox(0, TEXT("문자열이다."), TEXT("타이틀문자열"), MB_OKCANCEL | MB_ICONHAND);
⑴ 윈도우의 핸들
⑵ 메시지 출력 내용
⑶ 타이틀바 문자열
⑷ 버튼의 모양 및 ICON 모양
① Win32 프로젝트 방식
② 콘솔 프로그래밍
#pragma comment (linker,"/subsystem:windows")#pragma comment (linker,"/subsystem:console")P - PointerLP - Win32에서 L 키워드는 의미 없다. (PSTR==LPSTR)T, t - 범용 타입W - Unicode TypeC - constSTR - 문자열