English 中文(简体)
如何使用双双双双管线停止运行?
原标题:How to suspend a running thread using win32 api s?

......

  1. 在被中止状态下 Create立。

    hThrd1 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) ThreadProc1, (LPVOID)
    &obj1, CREATE_SUSPENDED, &dwFirstThreadID);
    
  2. 必要时恢复校对

    ResumeThread(hThrd1);
    

我如何暂停这一 running。 一段时间后,我可以恢复,但我现在要暂停。

    SuspendThread(hThrd1);

然而,ThreadProc的住宿仍然保持正常。 现在我是如何避免的? 还建议我提出任何备选办法。

最佳回答

我谈这个问题。 最初,WndProc宣布HANDLE hThrd1。 由于WndProc被再次称作“安乐”组织,我还在“创造”期间穿戴的“HANDLE”与暂停阅读的一样。 (这是令人难堪的错误)

现在我已经在全球宣布。 这解决了这一问题,并按预期开展工作。

问题回答

暂无回答




相关问题
How to read exact number of bytes from a stream (tcp) socket?

In winsock, both the sync recv and the async WSARecv complete as soon as there is data available in a stream socket, regardless of the size specified (which is only the upper limit). This means that ...

AcquireCredentialsHandle returns SEC_E_NO_CREDENTIALS

I created a self-signed certificate (created using OpenSSL) and installed it into the Certificate Store using the Certificates MMC snap-in (CertMgr.msc) on Windows Vista Ultimate. I have managed to ...

Calling Win32 EnumThreadWindows() in C#

I m trying to get a call to EnumThreadWindows working, but I always get a Wrong Parameter-Error, although my code is nearly the same as this example on pinvoke.net. I don t know why this doesn t work: ...

COM Basic links

folks can you provide me the tutorial link or .pdf for learning basic COM?. i do google it.. still i recommend answers of stackoverflow so please pass me.. Thanks

Handling multiple windows WIN32 API

HI I m trying to create an application in the Win32 environment containing more than one window. How do i do that? all the Win32 Tutorials on web i found only showed how to manage one window. How do i ...

Creating a thread in DllMain?

It seems that when a thread is created from within DllMain upon DLL_PROCESS_ATTACH it won t begin until all dll s have been loaded. Since I need to make sure the thread runs before I continue, I get a ...

热门标签