본문 바로가기

Windows/Windows API

핫키 (hotkey, HIBYTE, HKM_GETHOTKEY, HOTKEYF_CONTROL, HOTKEYF_SHIFT, HOTKEYF_ALT, HOTKEYF_EXT) #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; LPSTR lpszClass="HotKeyCtrl"; int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance ,LPSTR lpszCmdParam,int nCmdShow) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst=hInstance; if(!hPrevInstance) { WndClass.cbClsExtra=0; WndClass.cbWndExtra=0; WndClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);.. 더보기
핫키 (hotkey, RegisterHotKey, IsIconic, SetActiveWindow, SetForegroundWindow, UnregisterHotKey) #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; HWND hWndMain; LPSTR lpszClass="HotKeyTest"; 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); WndCl.. 더보기
애니매이션 컨트롤 (Animate) #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; LPSTR lpszClass="MyAnimate"; int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance ,LPSTR lpszCmdParam,int nCmdShow) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst=hInstance; if(!hPrevInstance) { WndClass.cbClsExtra=0; WndClass.cbWndExtra=0; WndClass.hbrBackground=(HBRUSH)(COLOR_BTNFACE+1); WndClass.h.. 더보기
스핀, 업다운컨트롤 (spin, updown) Trackbar Control Reference This section contains information about the programming elements used with trackbar controls. Overviews Trackbar Controls A trackbar is a window that contains a slider and optional tick marks. When the user moves the slider, using either the mouse or the direction keys, the trackbar sends notification messages to indicate the change. Messages TBM_CLEARSEL Clears the cu.. 더보기
스핀,업다운컨트롤 (UPDOWN_CLASS, UDM_SETBUDDY, commctrl.h) #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; LPSTR lpszClass="UpDown"; int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance ,LPSTR lpszCmdParam,int nCmdShow) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst=hInstance; if(!hPrevInstance) { WndClass.cbClsExtra=0; WndClass.cbWndExtra=0; WndClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH); Wnd.. 더보기
트랙바 (trackbar, commctrl.h, TBM_SETRANGE) #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; LPSTR lpszClass="MyTrackBar"; int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance ,LPSTR lpszCmdParam,int nCmdShow) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst=hInstance; if(!hPrevInstance) { WndClass.cbClsExtra=0; WndClass.cbWndExtra=0; WndClass.hbrBackground=(HBRUSH)(COLOR_BTNFACE+1); WndClass... 더보기
트랙바 (trackbar) Trackbar Control Reference This section contains information about the programming elements used with trackbar controls. Overviews Trackbar Controls A trackbar is a window that contains a slider and optional tick marks. When the user moves the slider, using either the mouse or the direction keys, the trackbar sends notification messages to indicate the change. Messages TBM_CLEARSEL Clears the cu.. 더보기
프로그래스 (PROGRESS, InitCommonControls, commctrl.h, comctl32.lib) /* ########### 선행조건 ############ #include WM_CREATE -> InitCommonControls(); comctl32.lib linked */ #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; LPSTR lpszClass="MyProgress"; int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance ,LPSTR lpszCmdParam,int nCmdShow) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst=hInstance; if(!hPrevInstance) { WndCl.. 더보기
해당영역에 마우스 위치 있는지 확인 (TRACKMOUSEEVENT, TrackMouseEvent, WM_MOUSEHOVER, WM_MOUSELEAVE, WM_MOUSEMOVE,mouseover) #define _WIN32_WINNT 0x0400 #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; HWND hWndMain; LPCTSTR lpszClass=TEXT("TrackMouse"); 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=(HBRUS.. 더보기
스크롤바 란에 정보 넣기(scrollbar, MoveWindow, PrintPosition) #include LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; HWND g_hWndMain; LPSTR lpszClass="ScrWnd2"; int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance ,LPSTR lpszCmdParam,int nCmdShow) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst=hInstance; if(!hPrevInstance) { WndClass.cbClsExtra=0; WndClass.cbWndExtra=0; WndClass.hbrBackground=(HBRUSH)GetStockObject.. 더보기