15,979
社区成员
发帖
与我相关
我的任务
分享
#pragma once
//内核线程消息路由窗口
class CRoutingWnd : public CWnd
{
DECLARE_DYNAMIC(CRoutingWnd)
public:
CRoutingWnd();
virtual ~CRoutingWnd();
BOOL Create();
protected:
DECLARE_MESSAGE_MAP()
//获取线程ID
afx_msg LRESULT OnGetThreadID(WPARAM w, LPARAM l);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};
#include "stdafx.h"
#include "RoutingWnd.h"
#include "KernelThread.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
// CRoutingWnd
//InterpEngine
IMPLEMENT_DYNAMIC(CRoutingWnd, CWnd)
CRoutingWnd::CRoutingWnd()
{
}
CRoutingWnd::~CRoutingWnd()
{
}
BEGIN_MESSAGE_MAP(CRoutingWnd, CWnd)
ON_WM_CREATE()
END_MESSAGE_MAP()
//获取线程ID
LRESULT CRoutingWnd::OnGetThreadID(WPARAM /*w*/, LPARAM /*l*/)
{
return ::GetCurrentThreadId();
}
int CRoutingWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
TRACE("routing wnd created success!\n");
return 0;
}
BOOL CRoutingWnd::Create()
{
CString str = AfxRegisterWndClass(0);
if (!CreateEx(0, str, _T("Kernel Router"),
WS_OVERLAPPED, 0, 0, 0, 0, NULL, NULL))
{
return FALSE;
}
return TRUE;
}