Re: ShowCursor(FALSE) should hide cursor!
- From: "Robby" <Robby@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 28 Dec 2005 10:19:03 -0800
Gee... A little bit of history goes along way!
So could of I have better said:
(In plain english, it loads a cursor type for the
current application!) Right!
And now I understand the use of WM_SETCURSOR !
Thanks alot guys.. your time is much appreciated!
--
Best regards
Robert
"Doug Harrison [MVP]" wrote:
> On Tue, 27 Dec 2005 22:26:02 -0800, "Robby"
> <Robby@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> >Although, I fully appreciate your post and I would like to confirm to myself
> >that I am not absorbing this in a misleading way.
> >
> >The way I am understanding this, is that LoadCursor loads the specified
> >cursor resource from the executable (.EXE) file associated with an
> >application instance.
>
> If it's a predefined cursor, e.g. IDC_ARROW, then it comes from the OS.
>
> >(In plain english, it loads a cursor type for the
> >current window!) Right!
>
> The function LoadCursor does not have an HWND parameter, so that tells you
> the cursor it loads is not associated with a window. The same can be said
> for SetCursor. So, in what sense is a cursor associated with a window? A
> window sets the cursor for the process that created it in response to
> WM_SETCURSOR, and the cursor remains in effect for the process until
> another window belonging to the process changes it.
>
> >SetCursor, sets the cursor shape. The cursor must have been created by the
> >CreateCursor function or loaded by the LoadCursor or LoadImage function.
> >
> >So, so far, load the cursor with LoadCursor and then set its shape! Right!
> >
> >ShowCursor, shows the cursor. If I say, ShowCursor(True) the internal
> >display counter increments. If I say, ShowCursor(FALSE) the internal display
> >counter decrements. And any time the counter is negative, the cursor is
> >hidden.(I have experimented with this and I am surprised in that why Windows
> >chose this mechanism. (Why not simply say, ShowCursor(True) shows the cursor
> >and ShowCursor(FALSE) hides the cursor. Why must we add this "internal
> >counter and hide if negative stuff!")
> >
> >Anyways, I am sure there is a reason, but right now it is beyond me!
>
> It was really important back in the day when video cards didn't support the
> cursor in hardware. A software cursor must be hidden before drawing over
> the area where it resides, else you can get an effect known as "mouse
> droppings":
>
> http://catb.org/~esr/jargon/html/M/mouse-droppings.html
>
> Suppose you had two drawing functions, one which renders the background and
> the other the foreground. For safety reasons, each hides the cursor and
> restores it when done. Now suppose you wrote this function:
>
> void draw_everything()
> {
> draw_bk();
> draw_fg();
> }
>
> This would cause the cursor to flicker. You could fix it by bracketing the
> contents with hide/show cursor calls, but for that to work, the visibility
> state needs to be reference-counted. (I believe Windows always did the
> hiding/showing for you in BeginPaint/EndPaint, but other OS's did not.)
>
> --
> Doug Harrison
> Visual C++ MVP
>
.
- References:
- ShowCursor(FALSE) should hide cursor!
- From: Robby
- Re: ShowCursor(FALSE) should hide cursor!
- From: Doug Harrison [MVP]
- Re: ShowCursor(FALSE) should hide cursor!
- From: Robby
- Re: ShowCursor(FALSE) should hide cursor!
- From: Doug Harrison [MVP]
- ShowCursor(FALSE) should hide cursor!
- Prev by Date: Re: where is a copy of atlstr.h ??
- Next by Date: Re: where is a copy of atlstr.h ??
- Previous by thread: Re: ShowCursor(FALSE) should hide cursor!
- Next by thread: compile error msg: Inconsistent layout information
- Index(es):
Relevant Pages
- Re: => Query to copy tbl1 split entries into tbl2
... Enter Cursor ... Enters LineSplit = 0 ... Loop to next
record in the cursor ... DeliveryID CollectionID TempID OrderDate Loads ... (microsoft.public.access.queries) - Re: ShowCursor(FALSE) should hide cursor!
... >The way I am understanding this, is that LoadCursor loads the specified ...
If it's a predefined cursor, e.g. IDC_ARROW, then it comes from the OS. ... The function
LoadCursor does not have an HWND parameter, ... the cursor it loads is not associated with
a window. ... (microsoft.public.vc.language) - applet & swing
... JTextField as soon as an applet loads? ... the cursor in the name
JTextField when the applet first loads. ... (comp.lang.java.help) - The cursor curse
... I'm using a text processing component called txText. ... When it loads
an rtf file, it changes the cursor for my whole application. ... (comp.lang.basic.visual.misc) - Re: Setting default mouse position
... When a page loads, you want to change the location of ... If I went to a page
that made my cursor jump to ... wherever it wanted it, i'd close that window and
never, ever go back. ... (comp.lang.javascript)