From 21bd7a08615b388bc536d3ffb1e3efce7e5f7673 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 10 Jul 2020 23:11:10 +0800 Subject: *icon --- src/extern/wog.c | 16 ++++++++++++++-- src/extern/wog.h | 4 ++++ 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src/extern') diff --git a/src/extern/wog.c b/src/extern/wog.c index ad8f334..99a110a 100644 --- a/src/extern/wog.c +++ b/src/extern/wog.c @@ -283,7 +283,8 @@ static int registerWindowClass() windowClass.lpfnWndProc = (WNDPROC)(WindowProc); // WindowProc Handles Messages windowClass.hInstance = GetModuleHandle(0); // Set The Instance windowClass.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE); // Class Background Brush Color - windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); // Load The Arrow Pointer + //windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); // Load The Arrow Pointer + //windowClass.hCursor = LoadImageA(NULL, "PanView.ico", IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_LOADFROMFILE); windowClass.lpszClassName = WINDOW_CLASS; // Sets The Applications Classname if (RegisterClassEx(&windowClass) == 0) // Did Registering The Class Fail? @@ -676,4 +677,15 @@ void wog_sleep(int ms) int wog_tick() { return GetTickCount(); -} \ No newline at end of file +} + + +void wog_setcursor(wog_Window* wnd, unsigned int cursor) +{ + SetCursor(LoadCursor(NULL, cursor)); +} + +void wog_setcursorImage(wog_Window* wnd, const char* path) +{ + SetCursor(LoadImageA(NULL, path, IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_LOADFROMFILE)); +} diff --git a/src/extern/wog.h b/src/extern/wog.h index 6c5bc08..2052d07 100644 --- a/src/extern/wog.h +++ b/src/extern/wog.h @@ -206,4 +206,8 @@ void wog_registerQuitCallback(wog_Callback cal); wog_Surface* wog_getsurface(wog_Window* wnd); +void wog_setcursor(wog_Window* wnd, unsigned int cursor); +void wog_setcursorImage(wog_Window* wnd, const char* path); + + #endif \ No newline at end of file -- cgit v1.1-26-g67d0