The wait icon is displayed when the operation is executed for a long time.

Source: Internet
Author: User

The wait icon is displayed when the operation is executed for a long time.

If you need to wait for a long time in the program, you can display the wait icon to give you a better experience.
In Win32, The setcursor () function is used to set the displayed icon.
The description of this function in msdn is:
Hcursor setcursor (
Hcursor
);
Hcursor
[In] handle to the cursor. The cursor must have been created by the createcursor or loaded by the loadcursor or LoadImage function. If this parameter is null, the cursor is removed from the screen.

The width and height of the cursor must be the values returned by the getsystemmetrics function for sm_cxcursor and sm_cycursor.

The loadcursor () function is required,
Hcursor loadcursor (
Hinstance,
Lpctstr lpcursorname
);
To use one of the Microsoft Win32 predefined cursors, the application must set the hinstance parameter to null and the lpcursorname parameter to a specific value. the following table shows the possible values. this parameter must be set to one of these values.

Value description
Idc_appstarting
Standard arrow and small Hourglass.
 
Idc_arrow
Standard arrow.
 
Idc_cross
Crosshair.
 
Idc_hand
Hand.
 
Idc_help
Arrow and question mark.
 
Idc_icon
Obsolete.
 
Idc_no
Slashed circle.
 
Idc_size
Obsolete; Use idc_sizeall.
 
Idc_sizeall
Four-pointed arrow pointing north, south, east, and west.
 
Idc_sizenesw
Double-pointed arrow pointing northeast and southwest.
 
Idc_sizens
Double-pointed arrow pointing north and south.
 
Idc_sizenwse
Double-pointed arrow pointing northwest and southeast.
 
Idc_sizewe
Double-pointed arrow pointing west and east.
 
Idc_uparrow
Vertical arrow.
 
Idc_wait
Hourglass.
 
Therefore, use the wait icon to display the system, which can be
Setcursor (loadcursor (null, idc_wait ));
Then, switch the default icon back at the end.
Setcursor (loadcursor (null, idc_arrow ));
 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.