PDA

View Full Version : Loadcursor



pran1
03-28-2004, 03:38 AM
Hi, I was wondering if some one could help me I am kind of stuck now for a long time. I want to display a cursor and for that I want to use win32's loadcursor() function and I was wondering if I can use it with to have to use this function because I have already written a program and this all seems to be a bit complicated.

BOOL CreateGLWindow(char* title, int width, int height,
int bits, bool fullscreenflag)
{
// First some standard Win32 window creating
GLuint PixelFormat;
WNDCLASS wc;
DWORD dwExStyle;
DWORD dwStyle;
RECT WindowRect;
WindowRect.left=(long)0;
WindowRect.right=(long)width;
WindowRect.top=(long)0;
WindowRect.bottom=(long)height;

// fullscreen variable
fullscreen=fullscreenflag;

hInstance = GetModuleHandle(NULL);
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wc.lpfnWndProc = (WNDPROC) WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL;
wc.lpszMenuName = NULL;
wc.lpszClassName = "OpenGL";




Is there a way to use just:

wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL;

as I just want this much and if yes where should I call this in my program eg.- in the Init() or in redisply or draw().

Thanks alot for you time and efforts.

regards,
Pran

wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL

mikael_aronsson
03-28-2004, 10:25 AM
Hi !

This has very little to do with OpenGL, but anyway.

Set wc.hCursor to NULL

Then use SetCursor(..) when ever you get a WM_MOUSEMOVE message, that way you can change the cursor at any time.

Mikael