home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / mswindo / programm / misc / 3355 < prev    next >
Encoding:
Internet Message Format  |  1992-11-10  |  2.0 KB

  1. Path: sparky!uunet!news.tek.com!ogicse!decwrl!elroy.jpl.nasa.gov!nntp-server.caltech.edu!heathh
  2. From: heathh@cco.caltech.edu (Heath Ian Hunnicutt)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Hourglass cursor help needed!
  5. Message-ID: <1dpa3uINNivt@gap.caltech.edu>
  6. Date: 10 Nov 92 21:38:06 GMT
  7. Article-I.D.: gap.1dpa3uINNivt
  8. References: <1992Nov9.171058.1@cortex>
  9. Organization: California Institute of Technology, Pasadena
  10. Lines: 50
  11. NNTP-Posting-Host: punisher.caltech.edu
  12.  
  13. mboucher@cortex.prospect.com (Mike Boucher) writes:
  14. >I have the following code, which should change my cursor to the hourglass...
  15.  
  16. >  SetCapture(hWnd);
  17. >  hHourGlass = LoadCursor(NULL, IDC_WAIT);
  18. >  hOrigCurr = SetCursor(hHourGlass);
  19.  
  20. >  CVSendItem (hWnd, STRTAPPOP, ...); <- obscenely long routine...
  21.  
  22. >  SetCursor(hOrigCurr);
  23. >  ReleaseCapture();
  24.  
  25. >When defining the windows class, I have this line...
  26. >  wc.hCursor = NULL;
  27.    ^^^^^^^^^^^^^^^^^^
  28.     This code needs to be changed.
  29.  
  30. >When I call the SetCursor, the cursor changes to the hourglass, and changes
  31. >right back to the arrow.  I'ts so fast It's barely noticable.  Any ideas what
  32. >I'm doing wrong?
  33.  
  34.     I have noticed a few times that if a class is registered with a
  35. NULL hCursor, that some of the API functions don't work as expected.
  36. Specifically, it seems that SetCursor will not change the window cursor
  37. away from NULL.  So, the cursor bitmap changes, but then the mouse moves.
  38. Windows checks to see where the cursor is, and what mouse cursor that
  39. region of screen is using.  (This occurs without regard to the current
  40. capture.)  Since your class specifies NULL, it changes back to the arrow.
  41.  
  42.     Try changing your code to wc.hCursor=LoadCursor(NULL,IDC_ARROW);
  43.  
  44.     So here's my question -- Is there an advantage to:
  45.  
  46. hOldCaptureWnd=SetCapture(hWnd);
  47. .
  48. .
  49. .
  50. if (hOldCaptureWnd)
  51.     SetCapture(hOldCaptureWnd);
  52. else
  53.     ReleaseCapture();
  54.  
  55. as opposed to just blindly calling ReleaseCapture() when done?
  56.  
  57.  
  58.  
  59. -- 
  60. --
  61. From the Home for Amnesiac Computer Scientists....
  62.   heathh@cco.caltech.edu
  63.