[[프로그래밍_NOTE]] 124

SetPixel()을 이용한 LineTo() 함수 구현

LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam) { /////////////////////////////////// HDC hdc; static int x1, y1, x2, y2; /////////////////////////////////// switch(iMessage) { case WM_LBUTTONDOWN: x1=LOWORD(lParam); y1=HIWORD(lParam); return 0; case WM_LBUTTONUP: x2=LOWORD(lParam); y2=HIWORD(lParam); hdc=GetDC(hWnd); /////////////////////////////////// Line(hdc, x1..

WinMain

#include LRESULT CALLBACK WndProc( HWND hwnd , UINT message , WPARAM wParam , LPARAM lParam ) ; int WINAPI WinMain( HINSTANCE hInstance , HINSTANCE hPrevInstance , LPTSTR lpszCmdLine , int nCmdShow) { static char szAppName[] = "윈도우 클래스 이름"; static char szTitleName[] = "타이틀바에 출력 내용" ; WNDCLASS WndClass ; HWND hwnd; MSG msg; /*윈도우 클래스 구조체 생성*/ WndClass.style = CS_HREDRAW | CS_VREDRAW ; WndClass.lp..

%#010X 란?

#의 의미 출처: MSDN When used with the o, x, or X format, the # flag prefixes any nonzero output value with 0, 0x, or 0X, respectively. 이게 무슨뜻이냐 #은 o,x,X와 같이 쓰입니다.. 그리고 값을 출력하는데 0,0x,0X스타일로 출력합니다.. 한개식 설명하면 010x는 빈칸은 0으로체우고 10번째칸까지 체우라는것이고 x는 16진수 값을 출력해라 입니다.. 그래서 결과가 imsip = 10 이라면 %010x 출력은 0x0000000a 입니다.. %#010X 출력은 0X0000000A %#x 라고 하면 0xa 가 출력됩니다.. %x 라고 하면 a 가 출력됩니다.. #은 단독으로 실행될수가 없습니다..