How to delay in the program: 1 SLEEP (2000)
2 SLEEP is simple, but if the delay is relatively long, the system is like a crash, the following method can handle the message when delayed:
COleDateTime starttime = COleDateTime :: GetCurrentTime (); COleDateTimeSpan endtime = COleDateTime :: GetCurrentTime () - starttime; while (endtime.GetTotalSeconds () <2) {MSG msg; GetMessage (& msg, 0,0); PreTranslateMessage (& msg); EndTime = COLEDATETIME :: getcurrenttime () - starttime;