프로그래밍/WIN32 API 5

1,2일차 기본

2015.03.12. 15:51 #include #include /* ​ : API 함수들의 원형과 사용하는 상수들이 정의되어 있음. : 유니코드 기반의 코드 작성을 위한 헤더. wchar: Unicode 2byte:16bit ex)TCHAR *szString = L"ABC" char: ASCIIcode 1byte:8bit ex) char *szString = "ABC" */ ​LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); //LRESULT = long: OS에게 보고용자료 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR strCmdLine, int nShowCmd) // WinMai..

마우스좌표 나타내기

2015.03.13. 10:58 * MAKEPOINTS(lParam) : lParam에서 한꺼번에받은 마우스좌표가 x, y로 나뉨. SetWindowText 마우스좌표를 컨셉창에 출력. ​ ​ #include #include /* wchar: Unicode 2byte:16bit ex)TCHAR *szString = L"ABC" char: ASCIIcode 1byte:8bit ex) char *szString = "ABC" */ #define MY_MESSAGE WM_USER+1 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); //LRESULT = long: OS에게 보고용자료 int WINAPI WinMain(HINSTANCE hInstance, HINST..

Basic

2015.03.20. 22:11 *기본적인 부모윈도우를 띄우는 베이직소스!​ ​ #include #include /*Unicode: wchar: Unicode(2byte:16bit, TCHAR *szString = L"ABC") char:ASCIIcode(1byte:8bit, char *szString = ABC")) */ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); //LRESULT= long: OS에게보고용자료 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR strCmdLine, int nShowCmd) //WINAPI WinMain: Windows 실행방식 //HINSTANCE..

Pen, Brush

2015.03.21. 01:13 *BeginPaint/EndPaint 는 WM_PAINT메세지에서만 사용 할 수 있다. GetDC/ReleaseDC는 그외 메세지에서 사용가능! 둘의 차이점: 무효화영역(다른 윈도우에 의해 가려지거나, 최소화 등)이 발생할때, BeginPaint는 다시 그려져서 유지되는것처럼 보이고 GetDC는 다시 그려지지 않아서 사라짐​ *Pen: 테두리 Brush:안쪽 채우기​ ​ //////////////////////////////////////////Pen​ ​#include #include ​ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE..