Board index » cppbuilder » Forcing the mouse cursor to change.

Forcing the mouse cursor to change.


2003-08-16 09:34:44 PM
cppbuilder11
Hello all.
Sometimes when I assign a new mouse cursor to Screen->Cursor it won't change
straight away even if I call ProcessMessages.
Does anyone know of any tricks for forcing the cursor to change.
Thanks in advance.
David.
 
 

Re:Forcing the mouse cursor to change.

"David" < XXXX@XXXXX.COM >wrote:
Quote
Sometimes when I assign a new mouse cursor to Screen->Cursor
it won't change straight away even if I call ProcessMessages.
Your description is too vauge without an example to tell you
why it's not behaving as you expect.
Quote
Does anyone know of any tricks for forcing the cursor to change.
Again, without more details as to the circumstances, it hard
to say. For example, if you don't want the cursor with the
pointer and the small hourglass ({*word*99}pStart) but rather the
single large hourglass (crHourGlass), you can replace one
cursor with the other:
HCURSOR hCursor = Screen->Cursors[ {*word*99}pStart ];
Screen->Cursors[ {*word*99}pStart ] = Screen->Cursors[ crHourGlass ];
// do what ever and then restore the cursor
Screen->Cursors[ {*word*99}pStart ] = hCursor;
~ JD
 

Re:Forcing the mouse cursor to change.

No I just want to change to one of the built in types for example;
Screen->Cursor={*word*99}pStart;
This does not always happens straight away as the help file suggests as
well.
David
"JD" < XXXX@XXXXX.COM >wrote in message
Quote

"David" < XXXX@XXXXX.COM >wrote:
>Sometimes when I assign a new mouse cursor to Screen->Cursor
>it won't change straight away even if I call ProcessMessages.

Your description is too vauge without an example to tell you
why it's not behaving as you expect.

>Does anyone know of any tricks for forcing the cursor to change.

Again, without more details as to the circumstances, it hard
to say. For example, if you don't want the cursor with the
pointer and the small hourglass ({*word*99}pStart) but rather the
single large hourglass (crHourGlass), you can replace one
cursor with the other:

HCURSOR hCursor = Screen->Cursors[ {*word*99}pStart ];
Screen->Cursors[ {*word*99}pStart ] = Screen->Cursors[ crHourGlass ];
// do what ever and then restore the cursor
Screen->Cursors[ {*word*99}pStart ] = hCursor;

~ JD

 

{smallsort}

Re:Forcing the mouse cursor to change.

"David" < XXXX@XXXXX.COM >wrote:
Quote
No I just want to change to one of the built in types for example;
My point was that if setting the cursor doesn't immediately
display, even using Application->ProcessMessages, you could
try to temporarily replace the offending cursor with the one
that you do want.
~ JD