Hi All!
I have two questions:
1. How to change a mouse cursor at run-time?
2. How to change background color of a window at run-time?
I think these are very simple questions but I find decisions for a long time :(
Posted on 2001-09-06 21:38:52 by vkim
> 1. How to change a mouse cursor at run-time?
SetCursor()

> 2. How to change background color of a window at run-time?

Two ways (that I know of):
1. Use SetClassLong() with GCL_HBRBACKGROUND and a solid brush with the colour you want to paint your background with.

2. Set hbrBackground (in WNDCLASS) to NULL and process WM_ERASEBKGND yourself with FillRect().
Posted on 2001-09-07 04:23:53 by Boggy
Thank You very much, Boggy!
You advice about SetClassLong is very nice. But SetCursor doesn't work. I write:


invoke LoadCursor, NULL, IDC_WAIT
invoke SetCursor, eax

There is no effect! :(
Posted on 2001-09-07 05:38:31 by vkim
Win32 help has this remark:

If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved.

This is probably the reason.

KetilO
Posted on 2001-09-07 07:16:03 by KetilO