home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.tek.com!ogicse!decwrl!elroy.jpl.nasa.gov!nntp-server.caltech.edu!heathh
- From: heathh@cco.caltech.edu (Heath Ian Hunnicutt)
- Newsgroups: comp.os.ms-windows.programmer.misc
- Subject: Re: Hourglass cursor help needed!
- Message-ID: <1dpa3uINNivt@gap.caltech.edu>
- Date: 10 Nov 92 21:38:06 GMT
- Article-I.D.: gap.1dpa3uINNivt
- References: <1992Nov9.171058.1@cortex>
- Organization: California Institute of Technology, Pasadena
- Lines: 50
- NNTP-Posting-Host: punisher.caltech.edu
-
- mboucher@cortex.prospect.com (Mike Boucher) writes:
- >I have the following code, which should change my cursor to the hourglass...
-
- > SetCapture(hWnd);
- > hHourGlass = LoadCursor(NULL, IDC_WAIT);
- > hOrigCurr = SetCursor(hHourGlass);
-
- > CVSendItem (hWnd, STRTAPPOP, ...); <- obscenely long routine...
-
- > SetCursor(hOrigCurr);
- > ReleaseCapture();
-
- >When defining the windows class, I have this line...
- > wc.hCursor = NULL;
- ^^^^^^^^^^^^^^^^^^
- This code needs to be changed.
-
- >When I call the SetCursor, the cursor changes to the hourglass, and changes
- >right back to the arrow. I'ts so fast It's barely noticable. Any ideas what
- >I'm doing wrong?
-
- I have noticed a few times that if a class is registered with a
- NULL hCursor, that some of the API functions don't work as expected.
- Specifically, it seems that SetCursor will not change the window cursor
- away from NULL. So, the cursor bitmap changes, but then the mouse moves.
- Windows checks to see where the cursor is, and what mouse cursor that
- region of screen is using. (This occurs without regard to the current
- capture.) Since your class specifies NULL, it changes back to the arrow.
-
- Try changing your code to wc.hCursor=LoadCursor(NULL,IDC_ARROW);
-
- So here's my question -- Is there an advantage to:
-
- hOldCaptureWnd=SetCapture(hWnd);
- .
- .
- .
- if (hOldCaptureWnd)
- SetCapture(hOldCaptureWnd);
- else
- ReleaseCapture();
-
- as opposed to just blindly calling ReleaseCapture() when done?
-
-
-
- --
- --
- From the Home for Amnesiac Computer Scientists....
- heathh@cco.caltech.edu
-