ShowCursor(FALSE) should hide cursor!



Hello,

I am currently learning the CONNECT.C program on P. 277 of chapter 7 of
Petzold's book. My question is:

Why is it that after the WM_PAINT messge is processed, the cursor is still
visible? Here is the fragment of code:

case WM_PAINT:
hdc = BeginPaint(hwnd,&ps);

SetCursor(LoadCursor(NULL,IDC_WAIT));
ShowCursor(TRUE);

for(i = 0; i < iCount - 1; i++)
for(j = i + 1; j < iCount; j++)
{
MoveToEx(hdc,pt[i].x,pt[i].y,NULL);
LineTo (hdc,pt[j].x,pt[j].y);
}

ShowCursor(FALSE);
SetCursor(LoadCursor(NULL,IDC_CROSS));


EndPaint(hwnd,&ps);
return 0;

So, It seems that when the WM_PAINT begins, it sets the cursor to an hour
glass and shows the cursor as so:

SetCursor(LoadCursor(NULL,IDC_WAIT));
ShowCursor(TRUE);

And at the end of the WM_PAINT code the cursor is hidden and set to an arrow
by:

ShowCursor(FALSE);
SetCursor(LoadCursor(NULL,IDC_ARROW));

BUT BY NOW, THE CURSOR SHOUL BE HIDDEN ????
Then why is it still visible. Further more, I have read the set Cursor help
on msdn and it says:

"The cursor is a shared resource. A window should set the cursor shape only
when the cursor is in its client area or when the window is capturing mouse
input. In systems without a mouse, the window should restore the previous
cursor before the cursor leaves the client area or before it relinquishes
control to another window.

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. "

So I set the following property for the Window's classes member data hCursor
as so:

wndclass.hCursor = NULL;

But the cursor is still visible. ?????

Anyone.....

Merry XMAS everyone !!!!!

Ross
--
Best regards
Robert
.



Relevant Pages

  • Re: convert hyperlink to email address
    ... If the Project Explorer is not showing, ... A blank window should open up to the right. ... then you can close the VBE. ... won't be any changes (except the flashing cursor moving down to the next ...
    (microsoft.public.excel.programming)
  • Re: Customising Word for Visually-Impaired
    ... the application will grab hold of the cursor and do its own thing with it. ... perhaps a black-bordered window around the insertion point to draw attention ... But I've found it impossible to get the handle of the Word window ... Control Panel> Accessibility Options> Display> Cursor Width ...
    (microsoft.public.windowsxp.accessibility)
  • RE: hide cursor for kiosk application (powerpoint)
    ... you use a WebBrowser control to display ... PowerPoint document and you'd like to hide the cursor on the WebBrowser. ... I watch the messages of the paneClassDC "Slide Show" window. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Detecting button push
    ... David Olsson wrote: ... > I have a window with a number of buttons (created using CreateWindow ... mouse button while the cursor is in the client area of a window. ... Value of the high-order word of lParam. ...
    (microsoft.public.win32.programmer.ui)
  • Re: MFC: Drag & Drop ohne die Maus zu verwenden?
    ... >> system will direct mouse input to the specified window only if a mouse ... > Prozess bekommt IMHO keine Nachricht das der Cursor über seinem Fenster ... Ich bin da auf einen Artikel gestossen mit mouse_event, ...
    (microsoft.public.de.vc)