MyTab.cpp
资源名称:WarH_2.10.rar [点击查看]
上传用户:tree100901
上传日期:2016-07-12
资源大小:182k
文件大小:2k
源码类别:
外挂编程
开发平台:
Visual C++
- // MyTab.cpp : 实现文件
- //
- #include "stdafx.h"
- #include "WarH.h"
- #include "MyEdit.h"
- #include "Dlg1.h"
- #include "Dlg2.h"
- #include "Dlg3.h"
- #include "Dlg4.h"
- #include "Dlg5.h"
- #include "Dlg6.h"
- #include "MyTab.h"
- // CMyTab 对话框
- IMPLEMENT_DYNAMIC(CMyTab, CDialog)
- CMyTab::CMyTab(CWnd* pParent /*=NULL*/)
- : CTabCtrl()
- {
- m_nCurDlg = 0;
- }
- CMyTab::~CMyTab()
- {
- }
- void CMyTab::DoDataExchange(CDataExchange* pDX)
- {
- CTabCtrl::DoDataExchange(pDX);
- }
- BOOL CMyTab::OnChildNotify(UINT nCode, WPARAM wParam, LPARAM lParam, LRESULT* lResult)
- {
- int pos = GetCurSel();
- if (pos != m_nCurDlg)
- {
- dlg[m_nCurDlg]->ShowWindow(SW_HIDE);
- m_nCurDlg = pos;
- dlg[m_nCurDlg]->ShowWindow(SW_SHOW);
- }
- return CTabCtrl::OnChildNotify(nCode, wParam, lParam, lResult);
- }
- BEGIN_MESSAGE_MAP(CMyTab, CTabCtrl)
- END_MESSAGE_MAP()
- // CMyTab 消息处理程序
- void CMyTab::InitTab()
- {
- InsertItem(0, _T("使用说明"));
- InsertItem(1, _T("自定热键"));
- InsertItem(2, _T("高级设置"));
- InsertItem(3, _T("启动设置"));
- InsertItem(4, _T("魔兽秘籍"));
- InsertItem(5, _T("附加功能"));
- #define INIT_DLG(n) {dlg[n - 1] = new CDlg##n;
- dlg[n - 1]->Create(CDlg##n::IDD, this);}
- INIT_DLG(1);
- INIT_DLG(2);
- INIT_DLG(3);
- INIT_DLG(4);
- INIT_DLG(5);
- INIT_DLG(6);
- #undef INIT_DLG
- CRect tabRect, itemRect;
- int nX, nY, nXc, nYc;
- GetClientRect(&tabRect);
- GetItemRect(0, &itemRect);
- nX = itemRect.left;
- nY = itemRect.bottom;
- nXc = tabRect.right - itemRect.left;
- nYc = tabRect.bottom - itemRect.bottom;
- for (int i = 0; i < DLG_COUNT; i ++)
- {
- dlg[i]->SetWindowPos(&wndTop, nX, nY, nXc, nYc, SWP_HIDEWINDOW);
- }
- dlg[m_nCurDlg]->ShowWindow(SW_SHOW);
- }