본문 바로가기

API30

API-일회용 타이머 한번 사용하고 버리는 일회용 타이머, #include LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ); HINSTANCE g_hInst; LPCTSTR lpszClass = TEXT("OnceTimer"); int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow ) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst = hInstance; WndClass.cbClsExtra = 0; WndClass.cbWndExtra = 0; WndClass.hbrBackground = (HBRUSH)Ge.. 2010. 4. 21.
API-무한의 작업을 위한 타이머(2) CALLBACK을 사용한 또 다른 무한 작업을 위한 타이머, #include LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ); HINSTANCE g_hInst; LPCTSTR lpszClass = TEXT("Callback"); int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow ) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst = hInstance; WndClass.cbClsExtra = 0; WndClass.cbWndExtra = 0; WndClass.hbrBackground .. 2010. 4. 21.
API-2개의 타이머 2개의 타이머를 사용하는 예제, #include LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ); HINSTANCE g_hInst; LPCTSTR lpszClass = TEXT("TwoTimer"); int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow ) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst = hInstance; WndClass.cbClsExtra = 0; WndClass.cbWndExtra = 0; WndClass.hbrBackground = (HBRUSH)GetSto.. 2010. 4. 21.
API-타이머 프로그램이 실행되면서 시간에 대해 설정하는 예제, #include LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ); HINSTANCE g_hInst; LPCTSTR lpszClass = TEXT("MyTimer"); int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow ) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst = hInstance; WndClass.cbClsExtra = 0; WndClass.cbWndExtra = 0; WndClass.hbrBackground = (HBRU.. 2010. 4. 21.
API-마우스입력 마우스 입력을 처리하는 예제, #include LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ); HINSTANCE g_hInst; LPCTSTR lpszClass = TEXT("Mouse"); int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow ) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst = hInstance; WndClass.cbClsExtra = 0; WndClass.cbWndExtra = 0; WndClass.hbrBackground = (HBRUSH)GetStockOb.. 2010. 4. 21.
API-Key입력(2) WM_CHAR는 문자에 대한 연산이고, 모든 키에 대한 연산을 위한 WM_KEYDOWN: #include LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM ); HINSTANCE g_hInst; LPCTSTR lpszClass = TEXT("keyDown"); int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow ) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst = hInstance; WndClass.cbClsExtra = 0; WndClass.cbWndExtra = 0; WndClass.. 2010. 4. 21.