📄 qq自动登陆器dlg.cpp
字号:
// QQ自动登陆器Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "QQ自动登陆器.h"
#include "QQ自动登陆器Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CQQDlg dialog
CQQDlg::CQQDlg(CWnd* pParent /*=NULL*/)
: CDialog(CQQDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CQQDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CQQDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CQQDlg)
DDX_Control(pDX, IDC_TAB1, m_TabQQlist);
DDX_Control(pDX, IDC_EXPLORER1, m_QQBanner);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CQQDlg, CDialog)
//{{AFX_MSG_MAP(CQQDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CQQDlg message handlers
BOOL CQQDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
TC_ITEM m_pTCItem1;
m_pTCItem1.mask = TCIF_TEXT;//接收的值为文本
m_pTCItem1.pszText = "QQ号码列表";//标签的名字
TC_ITEM m_pTCItem2;
m_pTCItem2.mask = TCIF_TEXT;
m_pTCItem2.pszText = "重要设置";
TC_ITEM m_pTCItem3;
m_pTCItem3.mask = TCIF_TEXT;
m_pTCItem3.pszText = "关于QQ登陆器";
m_TabQQlist.InsertItem(0,&m_pTCItem1);//插入到TAB控件中
m_TabQQlist.InsertItem(1,&m_pTCItem2);
m_TabQQlist.InsertItem(2,&m_pTCItem3);
//建立属性页各页
QList.Create(IDD_DIALOG1,GetDlgItem(IDC_TAB1));
QSet.Create(IDD_DIALOG2,GetDlgItem(IDC_TAB1));
QAboutDlg.Create(IDD_DIALOG3,GetDlgItem(IDC_TAB1));
//设置页面的位置在m_tab控件范围内
CRect rs;
m_TabQQlist.GetClientRect(rs);
rs.top+=20;
rs.bottom-=4;
rs.left+=4;
rs.right-=4;
QList.MoveWindow(rs);
QSet.MoveWindow(rs);
QAboutDlg.MoveWindow(rs);
QList.ShowWindow(TRUE);
m_TabQQlist.SetCurSel(0);
if (g_WndTopMost == "是")
{
SetWindowPos(&this->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
}
else
{
SetWindowPos(&this->wndNoTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
}
// 打出广告来http://hi.baidu.com/zhupf
CString MyAd ="about:<html><BODY scroll=\"no\" onmousewheel=\"return false\" onselectstart=\"return false\" oncontextmenu=\"return false\"><FONT color=\"#CC66FF\">QQ自动登陆器 v1.0</FONT> <FONT SIZE=0.1>by</FONT> <FONT SIZE=0.5 color=\"#0099FF\">zhupf</FONT> <A HREF=\"http://hi.baidu.com/zhupf\" target=\"_blank\" title=\"请访问我的百度空间对程序评论或下载本程序更新版本!\"><FONT SIZE=0.1>博客</FONT></A></BODY></html>";
m_QQBanner.Navigate(MyAd,NULL,NULL,NULL,NULL);
//m_QQBanner.Navigate2( &CComVariant(_T("about:blank")),NULL,NULL,NULL,NULL);
return TRUE; // return TRUE unless you set the focus to a control
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CQQDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CQQDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CQQDlg::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
{
if (ShowAddDlg == TRUE)
{
m_TabQQlist.SetCurSel(0);
return;
}
int CurSel;
CurSel=m_TabQQlist.GetCurSel();
QList.ShowWindow(FALSE);
QSet.ShowWindow(FALSE);
QAboutDlg.ShowWindow(FALSE);
switch(CurSel)
{
case 0:
QList.ShowWindow(TRUE);
QList.QQListUpdate();
break;
case 1:
QSet.ShowWindow(TRUE);
QSet.QQSetUpdate();
break;
case 2:
QAboutDlg.ShowWindow(TRUE);
break;
default: ;
}
*pResult = 0;
}
BOOL CQQDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN)
{
return TRUE;
}
if (pMsg->message == WM_KEYDOWN && (pMsg->wParam == VK_SPACE || pMsg->wParam == VK_ESCAPE))
{
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -