본문 바로가기
반응형

C/C++/API9

API TransparentBlt()함수 필요한 lib파일. Msimg32.lib #pragma comment(lib,"Msimg32") TransparentBlt 함수는 BOOL TransparentBlt( HDC hdcDest, // handle to destination DC int nXOriginDest, // x-coord of destination upper-left corner int nYOriginDest, // y-coord of destination upper-left corner int nWidthDest, // width of destination rectangle int hHeightDest, // height of destination rectangle HDC hdcSrc, // handle to source DC in.. 2009. 8. 5.
2009.07.27 API TIMER /*********************************************************************************************************** LRESULT CALLBACK WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM IParam) { HDC hdc; PAINTSTRUCT ps; SYSTEMTIME st; static TCHAR sTime[128]; switch(iMessage) { case WM_CREATE: //윈도우를 처음 생성하면 만들어지는 이벤트 (초기화) SetTimer(hWnd,1,1000,NULL); SendMessage(hWnd,WM_TIMER,1,0); return 0; case .. 2009. 7. 27.
2007.07.27 API Mouse입력 Mouse ------------------------------------------------------------------------- 버튼 누름 놓음 더블클릭 ------------------------------------------------------------------------- 좌측 WM_LBUTTONDOWN WM_LBUTTONUP WM_LBUTTONDBLCLK 우측 WM_RBUTTONDOWN WM_RBUTTONUP WM_RBUTTONDBLCLK 중앙 WM_MBUTTONDOWN WM_MBUTTONUP WM_MBUTTONDBLCLK ------------------------------------------------------------------------- 마우스 입력에 관한 메.. 2009. 7. 27.
2009.07.27 API KEY입력 WM_KEYDOWN ------------------------------------------------------------------------------------------------------ 가상키코드 값 키 ------------------------------------------------------------------------------------------------------- VK_LBUTTON 01 VK_RBUTTON 02 VK_CANCEL 03 Ctrl+Break VK_MBUTTON 04 VK_BACK 08 Backspace VK_TAB 09 Tab VK_CLEAR 0C NumLock이 꺼져 있을때의 5 VK_RETURN 0D Enter VK_SHIFT 10 Shift V.. 2009. 7. 27.
2009.07.27 API도형그리기 LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM IParam) { HDC hdc; PAINTSTRUCT ps; switch(iMessage) { /*윈도우 종료메세지(종료메세지가 없을시 메모리에 상주되어 있어 애러발생)*/ case WM_DESTROY: PostQuitMessage(0); //윈도우 종료메세지 return 0; /********************************************************************************************************** COLORREF SetPixel(HDC hdc, int X, int Y, COLORREF crColor); // .. 2009. 7. 27.
API기본 함수 //DC 얻는 방법 HDC GetDC(HWND hWnd); // 생성 int ReleaseDC(HWND hWnd,HDC hDC); //해제 // 윈도우 생성 HWND CreateWindow(lpszClassName, lpszWindowName, dwStyle, x, y, nWidth, nHeight, hwndParent, hmenu, hinst, lpvParam) // 윈도우 생성 BOOL ShowWindow(hWnd, nShowCmd) // 윈도우 화면에 출력 ------------------------------------------------------------------------ SW_HIDE 윈도우를 숨긴다. SW_MINIMIZE 윈도우를 최소화하고 활성화 시키지 않는다. SW_RESTORE.. 2009. 7. 27.
2009.07.24 API 수업 #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); //함수원형(파라미터에 인자 안적어둬도 됨) HINSTANCE g_hInst; LPCTSTR lpszClass=TEXT("First"); //타이틀바 이름 바꾸기 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.hbrBa.. 2009. 7. 24.
2009.07.23 API 수업 #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; LPCTSTR lpszClass=TEXT("First"); 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)GetStockObject(BLACK_BRUSH); //배경색 (흰색,회색,검정색) .. 2009. 7. 23.
WINAPI #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; LPCTSTR lpszClass=TEXT("First"); 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)GetStockObject(WHITE_BRUSH); WndClass.hCursor=L.. 2009. 7. 22.
반응형