TextOut 예제 #include LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); HINSTANCE g_hlnst; LPCTSTR lpszClass = TEXT("TextOut"); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hlnst=hInstance; WndClass.cbClsExtra = 0; WndClass.cbWndExtra = 0; WndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); Wn.. 더보기 First 예제 윈도우 창만들기 #include //윈도우즈 프로그램 헤더파일 /* 고정 형식 */ LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); //메시지 처리 함수 HINSTANCE g_hlnst; //instance 전역 선언 LPCTSTR lpszClass = TEXT("First"); //윈도클래스 이름 정의 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow) //시작점 { HWND hWnd; MSG Message; //MSG 구조체 사용 WNDCLASS WndClass; //WNDCLASS 구조체 사용 g_hlnst=hInstance.. 더보기 공용체(메모리 겹쳐쓰기를 허용) 공용체는 선언이나 사용방법이 구조체와 유사하지만 자료형이 다른 멤버들이 같은 메모리를 공유한다는 점이 다르다. 일반 구조체 #include typedef struct emb { unsigned int a; unsigned short b; unsigned char c; }EMB; int main() { EMB test; test.a = 0x12345678; test.b = 0xaaaa; test.c = 0xbb; printf("test.a = %08X\n", test.a); printf("test.b = %08X\n", test.b); printf("test.c = %08X\n", test.c); test.a = 0x11223344; printf("test.a = %08X\n", test.a); print.. 더보기 이전 1 ··· 8 9 10 11 12 13 14 ··· 98 다음