Re: Setting cursor for a button?
"Michael Bray" <mbrayATctiusaDOTcom@you.figure.it.out.com> wrote in message
news:Xns9950A14ACB7C7mbrayctiusacom@207.46.248.16...
David Lowndes <DavidL@example.invalid> wrote in
news:4uo573565e6eqq1micipcp6sfo9uhnt7ku@4ax.com:
It will do. You probably need to sub-class the button and handle
WM_SETCURSOR there rather than in the window that is the button's
parent.
Yeah I thought that might be the next logical answer.
But the problem for me there is what would I subclass? Because I'm not
using MFC, I don't know what class I would derive from - I only have what
the windows form resource designer is generating in the Resource file.
Maybe I'm just not understanding subclassing?
The other thing I tried along those lines was to re-assign the button's
WndProc using SetWindowLong as described in:
http://www.codeguru.com/forum/printthread.php?t=290195
(almost at the end of the page, in the scrollable window)
That is subclassing... which is kinda like a form of inheritance for
languages without object support.
but I was unable to get the code to compile because the line:
wpOrigButtonProc = (WNDPROC) SetWindowLong(hWndBtn1,
GWLP_WNDPROC, (LONG) NewButtonProc);
couldn't convert 'NewButtonProc' to a LONG. Perhaps someone could help me
get that to compile...
NewButtocProc can't be an instance member function (you will be passed an
HWND identifying the button, not a this pointer), so either outside a class
or else declared as a static member.
-mdb