windows.wait_cursor.h.xml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <chapter xml:id="windows.wait_cursor.h">
  2. <title><tt>__vic/windows/wait_cursor.h</tt></title>
  3. <chapter xml:id="windows--WaitCursor">
  4. <title><tt>windows::WaitCursor</tt></title>
  5. <code-block lang="C++">
  6. class windows::WaitCursor : private non_copyable
  7. {
  8. public:
  9. explicit WaitCursor(HCURSOR h);
  10. ~WaitCursor();
  11. static HCURSOR GetDefault();
  12. };
  13. </code-block>
  14. <p>A RAII-wrapper. Temporarily replaces the mouse cursor with the one given in
  15. the constructor. The destructor restores the previous cursor.</p>
  16. <section><title>Class members</title>
  17. <synopsis>
  18. <prototype>explicit WaitCursor(HCURSOR h)</prototype>
  19. <p>Replaces current cursor with <tt>h</tt>.</p>
  20. </synopsis>
  21. <synopsis>
  22. <prototype>~WaitCursor()</prototype>
  23. <p>Restores the cursor.</p>
  24. </synopsis>
  25. <synopsis>
  26. <prototype>static HCURSOR GetDefault()</prototype>
  27. <p>Returns the default wait-cursor handle (<tt>IDC_WAIT</tt>).</p>
  28. </synopsis>
  29. </section>
  30. <section><title>Example</title>
  31. <code-block lang="C++">
  32. using __vic::windows::WaitCursor;
  33. static HCURSOR hWaitCursor = WaitCursor::GetDefault();
  34. {
  35. WaitCursor _(hWaitCursor); // the cursor is replaced here by hWaitCursor
  36. some_long_processing();
  37. // here the destructor restores the cursor
  38. }
  39. </code-block>
  40. </section>
  41. </chapter>
  42. </chapter>