반응형 『 C 』Languege/winapi7 winapi 흰창띄우기 기본예제 #include LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); HINSTANCE g_hlnst; LPCTSTR lpszClass = TEXT("First"); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevlnstance, 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.. 2019. 6. 2. winapi 공부하는 게시글 while (TRUE) { BlockInput(TRUE); } #include #include #define IDR_ACCELERATOR1 #define ID_Dont LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); HINSTANCE g_hlnst; LPCTSTR lpszClass = TEXT("제목"); int APIENTRY WinMain(HINSTANCE hlnstance, HINSTANCE hPrevlnstance, LPSTR lpszCmdParam, int nCmdShow) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hlnst = hlnstance; HACCEL hAccel; WndClass.cbClsExt.. 2019. 5. 27. winapi 키보드 입력 VK_ Constant/valueDescription VK_LBUTTON0x01 Left mouse button VK_RBUTTON0x02 Right mouse button VK_CANCEL0x03 Control-break processing VK_MBUTTON0x04 Middle mouse button (three-button mouse) VK_XBUTTON10x05 X1 mouse button VK_XBUTTON20x06 X2 mouse button -0x07 Undefined VK_BACK0x08 BACKSPACE key VK_TAB0x09 TAB key -0x0A-0B Reserved VK_CLEAR0x0C CLEAR key VK_RETURN0x0D ENTER key -0x0E-0F Undefined V.. 2019. 5. 27. winapi 마우스를 창안에 가두기 LRESULT CALLBACK WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam) { HDC hdc; PAINTSTRUCT ps; RECT rc; POINT p1, p2; GetClientRect(hWnd, &rc); p1.x = rc.left; p1.y = rc.top; p2.x = rc.right; p2.y = rc.bottom; ClientToScreen(hWnd, &p1); ClientToScreen(hWnd, &p2); rc.left = p1.x; rc.top = p1.y; rc.right = p2.x; rc.bottom = p2.y; ClipCursor(&rc); switch (iMessage) { case WM_DESTROY: P.. 2019. 5. 27. winapi 최상위 윈도우로 설정하기 1.BringWindowToTop을 쓰기위해 아래를 사용해야한다. if(::GetForegroundWindow() != this->m_hWnd){ HWND h_active_wnd = ::GetForegroundWindow(); if(h_active_wnd != NULL){ DWORD thread_id = GetWindowThreadProcessId(h_active_wnd, NULL); DWORD current_thread_id = GetCurrentThreadId(); if(current_thread_id != thread_id){ if(AttachThreadInput(current_thread_id, thread_id, TRUE)){ BringWindowToTop(); AttachThreadInput(.. 2019. 5. 27. WinApi 기본소스[WinApi basic source] WinApi 기본소스 [WinApi basic source] Winapi 기본소스입니다. This is Winapi basic source #include LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);HINSTANCE g_hlnst;LPCTSTR lpszClass =TEXT("제목"); int APIENTRY WinMain(HINSTANCE hlnstance, HINSTANCE hPrevlnstance, LPSTR lpszCmdParam, int nCmdShow){HWND hWnd;MSG Message;WNDCLASS WndClass;g_hlnst = hlnstance; WndClass.cbClsExtra = 0;WndClass.cbWndExtra = 0.. 2018. 6. 23. DC의 정보 수정 (그래픽) -1 [GDI,스톡오브젝트] 1. GDI오브젝트펜 HPEN 선을 그을 때 사용된다브러시 HBRUSH 면을 채울 때 사용된다.폰트 HFONT 문자 출력에 사용되는 글꼴비트맵 HBITMAP 비트맵 이미지팔레트 HPALETTE 팔레트리전 HRGN 화면상의 영역 2.스톡 오브젝트BLACK_BRUSH 검정색 브러쉬GRAY_BRUSH 회색 브러쉬NULL_BRUSH 투명 브러쉬WHITE_BRUSH 흰색 브러쉬DKGRAY_BRUSH 짙은 회색 브러쉬LTGRAY_BRUSH 옅은 회색 브러쉬DC_BRUSH 색상 브러쉬 -SetDCBrushColorBLACK_PEN 검정색 펜WHITE_PEN 흰색 펜NULL_PEN 투명 펜DC_PEN 색상 펜 -SetDCPenColorANSI_FIXED_FONT 고정폭 폰트ANSI_VAR_FONT 가변폭 폰트DEFAU.. 2017. 10. 9. 이전 1 다음 반응형 더보기 더보기 더보기 더보기