// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "QQ.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
BEGIN_MESSAGE_MAP(CMainFrame, CUIWnd)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_BTN_MIN, OnBtnMin)
ON_BN_CLICKED(IDC_BTN_CLOSE, OnBtnClose)
ON_BN_CLICKED(IDC_RAD_QQ, OnRadQQ)
ON_BN_CLICKED(IDC_RAD_NETHD, OnRadNetHD)
ON_BN_CLICKED(IDC_RAD_CUSTOM, OnRadCustom)
ON_BN_CLICKED(IDC_RAD_CASE, OnRadCase)
ON_BN_CLICKED(IDC_RAD_PAIMAI, OnRadPaiMai)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CUIWnd::OnCreate(lpCreateStruct) == -1)
return -1;
CenterWindow();
// TODO: Add your message handler code here
if (!m_wndQQ.Create(NULL, NULL, WS_CHILD, CRect(0, 0, 0, 0), this, 1233))
return -1;
if (!m_wndNetHD.Create(NULL, NULL, WS_CHILD, CRect(0, 0, 0, 0), this, 1234))
return -1;
if (!m_wndCustom.Create(NULL, NULL, WS_CHILD, CRect(0, 0, 0, 0), this, 1235))
return -1;
if (!m_wndCase.Create(NULL, NULL, WS_CHILD, CRect(0, 0, 0, 0), this, 1236))
return -1;
if (!m_wndPaimai.Create(NULL, NULL, WS_CHILD, CRect(0, 0, 0, 0), this, 1237))
return -1;
CWnd *pStaPos = GetDlgItem(IDC_STA_POS);
CRect rcPos;
pStaPos->GetWindowRect(rcPos);
ScreenToClient(rcPos);
m_wndQQ.MoveWindow(rcPos);
m_wndNetHD.MoveWindow(rcPos);
m_wndCustom.MoveWindow(rcPos);
m_wndCase.MoveWindow(rcPos);
m_wndPaimai.MoveWindow(rcPos);
//
CSkinButton *pIM = (CSkinButton *)GetDlgItem(IDC_RAD_QQ);
ASSERT(pIM != NULL);
pIM->SetMaskBitmap("UnCheckedMask.bmp", "UnCheckedMask.bmp", "UnCheckedMask.bmp", NULL);
pIM->SetCheckedMaskBitmap("CheckedMask.bmp", "CheckedMask.bmp", "CheckedMask.bmp", NULL);
CSkinButton *pBBS = (CSkinButton *)GetDlgItem(IDC_RAD_NETHD);
ASSERT(pBBS != NULL);
pBBS->SetMaskBitmap("UnCheckedMask.bmp", "UnCheckedMask.bmp", "UnCheckedMask.bmp", NULL);
pBBS->SetCheckedMaskBitmap("CheckedMask.bmp", "CheckedMask.bmp", "CheckedMask.bmp", NULL);
CSkinButton *pBlog = (CSkinButton *)GetDlgItem(IDC_RAD_CUSTOM);
ASSERT(pBlog != NULL);
pBlog->SetMaskBitmap("UnCheckedMask.bmp", "UnCheckedMask.bmp", "UnCheckedMask.bmp", NULL);
pIM->SetCheckedMaskBitmap("CheckedMask.bmp", "CheckedMask.bmp", "CheckedMask.bmp", NULL);
CButton *pTab = (CButton *)GetDlgItem(IDC_RAD_QQ);
ASSERT(pTab->GetSafeHwnd() != NULL);
pTab->SetCheck(BST_CHECKED);
OnRadQQ();
return 0;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point)
{
SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y));
// TODO: Add your message handler code here and/or call default
CUIWnd::OnLButtonDown(nFlags, point);
}
void CMainFrame::OnBtnMin()
{
SendMessage(WM_SYSCOMMAND, SC_MINIMIZE);
}
void CMainFrame::OnBtnClose()
{
SendMessage(WM_CLOSE);
}
void CMainFrame::OnRadQQ()
{
// CWnd *pStaPos = GetDlgItem(IDC_STA_Pos);
// CRect rcPos;
// pStaPos->GetWindowRect(rcPos);
// ScreenToClient(rcPos);
// m_wndQQ.MoveWindow(rcQQ);
m_wndQQ.ShowWindow(SW_SHOW);
m_wndNetHD.ShowWindow(SW_HIDE);
m_wndCustom.ShowWindow(SW_HIDE);
m_wndCase.ShowWindow(SW_HIDE);
m_wndPaimai.ShowWindow(SW_HIDE);
CSkinButton *pQQ = (CSkinButton *)GetDlgItem(IDC_RAD_QQ);
pQQ->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pNetHD = (CSkinButton *)GetDlgItem(IDC_RAD_NETHD);
pNetHD->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pCustom = (CSkinButton *)GetDlgItem(IDC_RAD_CUSTOM);
pCustom->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pCase = (CSkinButton *)GetDlgItem(IDC_RAD_CASE);
pCase->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pPaiMai = (CSkinButton *)GetDlgItem(IDC_RAD_PAIMAI);
pPaiMai->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
pQQ->SetCheckedMaskBitmap("Mask.bmp", "Mask.bmp", "Mask.bmp", NULL);
pNetHD->SetMaskBitmap("Mask1.bmp", "Mask1.bmp", "Mask1.bmp", NULL);
pCustom->SetMaskBitmap("Mask1.bmp", "Mask1.bmp", "Mask1.bmp", NULL);
pCase->SetMaskBitmap("Mask1.bmp", "Mask1.bmp", "Mask1.bmp", NULL);
pPaiMai->SetMaskBitmap("Mask1.bmp", "Mask1.bmp", "Mask1.bmp", NULL);
}
void CMainFrame::OnRadNetHD()
{
m_wndNetHD.ShowWindow(SW_SHOW);
m_wndQQ.ShowWindow(SW_HIDE);
m_wndCustom.ShowWindow(SW_HIDE);
m_wndCase.ShowWindow(SW_HIDE);
m_wndPaimai.ShowWindow(SW_HIDE);
CSkinButton *pQQ = (CSkinButton *)GetDlgItem(IDC_RAD_QQ);
pQQ->SetWindowPos(NULL, 0, 0, 27, 33, SWP_NOMOVE);
CSkinButton *pNetHD = (CSkinButton *)GetDlgItem(IDC_RAD_NETHD);
pNetHD->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pCustom = (CSkinButton *)GetDlgItem(IDC_RAD_CUSTOM);
pCustom->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pCase = (CSkinButton *)GetDlgItem(IDC_RAD_CASE);
pCase->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pPaiMai = (CSkinButton *)GetDlgItem(IDC_RAD_PAIMAI);
pPaiMai->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
pQQ->SetMaskBitmap("Mask2.bmp", "Mask2.bmp", "Mask2.bmp", NULL);
pNetHD->SetCheckedMaskBitmap("Mask.bmp", "Mask.bmp", "Mask.bmp", NULL);
pCustom->SetMaskBitmap("Mask1.bmp", "Mask1.bmp", "Mask1.bmp", NULL);
pCase->SetMaskBitmap("Mask1.bmp", "Mask1.bmp", "Mask1.bmp", NULL);
pPaiMai->SetMaskBitmap("Mask1.bmp", "Mask1.bmp", "Mask1.bmp", NULL);
}
void CMainFrame::OnRadCustom()
{
m_wndCustom.ShowWindow(SW_SHOW);
m_wndQQ.ShowWindow(SW_HIDE);
m_wndNetHD.ShowWindow(SW_HIDE);
m_wndCase.ShowWindow(SW_HIDE);
m_wndPaimai.ShowWindow(SW_HIDE);
CSkinButton *pQQ = (CSkinButton *)GetDlgItem(IDC_RAD_QQ);
pQQ->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pNetHD = (CSkinButton *)GetDlgItem(IDC_RAD_NETHD);
pNetHD->SetWindowPos(NULL, 0, 0, 27, 33, SWP_NOMOVE);
CSkinButton *pCustom = (CSkinButton *)GetDlgItem(IDC_RAD_CUSTOM);
pCustom->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pCase = (CSkinButton *)GetDlgItem(IDC_RAD_CASE);
pCase->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pPaiMai = (CSkinButton *)GetDlgItem(IDC_RAD_PAIMAI);
pPaiMai->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
pQQ->SetMaskBitmap("Mask.bmp", "Mask.bmp", "Mask.bmp", NULL);
pNetHD->SetMaskBitmap("Mask3.bmp", "Mask3.bmp", "Mask3.bmp", NULL);
pCustom->SetCheckedMaskBitmap("Mask.bmp", "Mask.bmp", "Mask.bmp", NULL);
pCase->SetMaskBitmap("Mask1.bmp", "Mask1.bmp", "Mask1.bmp", NULL);
pPaiMai->SetMaskBitmap("Mask1.bmp", "Mask1.bmp", "Mask1.bmp", NULL);
}
void CMainFrame::OnRadCase()
{
m_wndCase.ShowWindow(SW_SHOW);
m_wndCustom.ShowWindow(SW_HIDE);
m_wndQQ.ShowWindow(SW_HIDE);
m_wndNetHD.ShowWindow(SW_HIDE);
m_wndPaimai.ShowWindow(SW_HIDE);
CSkinButton *pQQ = (CSkinButton *)GetDlgItem(IDC_RAD_QQ);
pQQ->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pNetHD = (CSkinButton *)GetDlgItem(IDC_RAD_NETHD);
pNetHD->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pCustom = (CSkinButton *)GetDlgItem(IDC_RAD_CUSTOM);
pCustom->SetWindowPos(NULL, 0, 0, 27, 33, SWP_NOMOVE);
CSkinButton *pCase = (CSkinButton *)GetDlgItem(IDC_RAD_CASE);
pCase->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
CSkinButton *pPaiMai = (CSkinButton *)GetDlgItem(IDC_RAD_PAIMAI);
pPaiMai->SetWindowPos(NULL, 0, 0, 27, 37, SWP_NOMOVE);
pQQ->SetMaskBitmap("Mask.bmp", "Mask.bmp", "Mask.bmp", NULL);
pNetHD->SetMaskBitmap("Mask1.bmp", "Mask1.bmp"