⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 leftview.h

📁 一个windows系统下查看网络拓扑结构的程序
💻 H
字号:
#pragma once

#include "DataSupport.h"
struct IcmpThreadParament2
{
	ULONG HostIP;
	ULONG NetMask;
	CWnd *MessageHandler;
	PVOID Buffer;
	bool Stop;
	LPARAM lp;
	WPARAM wp;
};
struct IcmpThreadPar
{
	IcmpThreadParament2 Parament;
	CHAR Buffer[128];
};
// CLeftView 视图
#define ADDROUTER (WM_USER+615)
#define WM_PING (WM_USER+104)
#define WM_PING_FINISH (WM_USER+105)
//struct ThreadStruc 
class CLeftView : public CTreeView
{
	DECLARE_DYNCREATE(CLeftView)

protected:
	CLeftView();           // 动态创建所使用的受保护的构造函数
	virtual ~CLeftView();
	char *NetIpToSubNet(u_long in)
	{
		static char output[12][3*4+3+1];
		static short which;
		u_char *p;

		p = (u_char *)∈
		which = (which + 1 == 12 ? 0 : which + 1);
		sprintf(output[which], "%d.%d.%d.%d", p[0], p[1], p[2], 0);
		return output[which];
	}
	char *NetIpTotring(u_long in)
	{
		static char output[12][3*4+3+1];
		static short which;
		u_char *p;

		p = (u_char *)∈
		which = (which + 1 == 12 ? 0 : which + 1);
		sprintf(output[which], "%d.%d.%d.%d", p[0], p[1], p[2],p[3]);
		return output[which];
	}
public:
	LRESULT OnAddRouter(WPARAM wp, LPARAM lp);
	LRESULT OnPing(WPARAM wp, LPARAM lp); 
	LRESULT OnPingFinish(WPARAM wp, LPARAM lp);
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	DECLARE_MESSAGE_MAP()
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
public:
	virtual void OnInitialUpdate();
	HTREEITEM Root;
private:

    CImageList *m_pImageList;
public:
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	BOOL AddBitmapToImageList(UINT nResourceID)
	{
		BOOL bReturn;
		CBitmap bmp;
		bReturn=bmp.LoadBitmap(nResourceID);
		if (bReturn!=FALSE)
		{	
		int nReturn=m_pImageList->Add(&bmp,RGB(255,255,255));
		bmp.DeleteObject();
		}
		return bReturn;
	}

	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
};


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -