int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPre,LPSTR lpCmd,int nShow)
{
HANDLE hHread2=CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE )ThreadProc2,NULL,NULL,NULL);
char cBuf[120]={0};
while (TRUE)
{
Sleep(2000);
CONTEXT context;
context.ContextFlags=CONTEXT_DEBUG_REGISTERS|CONTEXT_FULL;
if (GetThreadContext(hHread2,&context)==FALSE)
{
wsprintfA(cBuf,"获取调试信息失败:%x",GetLastError());
OutputDebugStringA(cBuf);
}
else
{
wsprintfA(cBuf,"调试:%x %x %x %x %x %x",context.Dr0,context.Dr1,context.Dr2,context.Dr3,context.Dr6,context.Dr7);
OutputDebugStringA(cBuf);
}
}
return 0;
}