高手来抢分哟!

解决方案 »

  1.   

    先开启的线程在参数表中指定为CREATE_SUSPEND后,在适当的时候(也就是你要开启线程的时间调用ResumeThread()可。
      

  2.   

    同意楼上的。
    BOOL CreateProcess(
      LPCTSTR lpApplicationName,
                             // pointer to name of executable module
      LPTSTR lpCommandLine,  // pointer to command line string
      LPSECURITY_ATTRIBUTES lpProcessAttributes,  // process security attributes
      LPSECURITY_ATTRIBUTES lpThreadAttributes,   // thread security attributes
      BOOL bInheritHandles,  // handle inheritance flag
      DWORD dwCreationFlags, // creation flags
      LPVOID lpEnvironment,  // pointer to new environment block
      LPCTSTR lpCurrentDirectory,   // pointer to current directory name
      LPSTARTUPINFO lpStartupInfo,  // pointer to STARTUPINFO
      LPPROCESS_INFORMATION lpProcessInformation  // pointer to PROCESS_INFORMATION
    );
    指定dwCreationFlags 为CREATE_SUSPENDED。
    The ResumeThread function decrements a thread's suspend count. When the suspend count is decremented to zero, the execution of the thread is resumed. DWORD ResumeThread(
      HANDLE hThread   // identifies thread to restart
    );
     
      

  3.   

    先开启的线程在参数表中指定为CREATE_SUSPEND后,用SetTimer设置定时器,在OnTimer中调用ResumeThread()。
      

  4.   

    方法1、在线程中Sleep一段时间,到时后执行;
    方法2、使用CreateWaitableTimer生成定时事件,然后使用WaitForSingleObject等待事件发生,然后执行。
      

  5.   

    先开启的线程在参数表中指定为CREATE_SUSPEND后,用SetTimer设置定时器,在OnTimer中调用ResumeThread()。大哥,OnTimer如何调用每一个线程,难道ResumeThread()将广播给所有的线程。