showipwnd.cpp
资源名称:1731.rar [点击查看]
上传用户:swkcbjrc
上传日期:2016-04-02
资源大小:45277k
文件大小:2k
源码类别:
游戏
开发平台:
Visual C++
- // showipwnd.cpp : implementation file
- //
- #include "stdafx.h"
- #include "..GameHigh.h"
- #include "..includeshowipwnd.h"
- #include "baseFunction.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CShowIpWnd
- CShowIpWnd::CShowIpWnd()
- {
- }
- CShowIpWnd::~CShowIpWnd()
- {
- }
- BEGIN_MESSAGE_MAP(CShowIpWnd, CWnd)
- //{{AFX_MSG_MAP(CShowIpWnd)
- ON_WM_PAINT()
- ON_WM_ERASEBKGND()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CShowIpWnd message handlers
- void CShowIpWnd::OnPaint()
- {
- CPaintDC dc(this); // device context for painting
- CBrush m_Brush;
- COLORREF clrBk =RGB(124, 176, 201);
- m_Brush.CreateSolidBrush(clrBk);
- RECT rect;
- memset(&rect, 0, sizeof(RECT));
- this->GetClientRect(&rect);
- dc.FillRect(&rect, &m_Brush);
- m_Brush.DeleteObject();
- LOGBRUSH lb;
- memset(&lb, 0, sizeof(LOGBRUSH));
- lb.lbColor =RGB(7, 47, 136);
- lb.lbStyle =BS_NULL;
- m_Brush.CreateBrushIndirect(&lb);
- CBrush* pOldBrush =(CBrush*)dc.SelectObject(&m_Brush);
- CPen m_Pen;
- m_Pen.CreatePen(PS_SOLID, 3, RGB(7,47, 136));
- CPen* pOldPen =(CPen*)dc.SelectObject(&m_Pen);
- memset(&rect, 0, sizeof(RECT));
- this->GetClientRect(&rect);
- rect.left +=2;
- rect.top +=1;
- rect.right -=1;
- rect.bottom -=1;
- dc.Rectangle(&rect);
- dc.SelectObject(pOldBrush);
- dc.SelectObject(pOldPen);
- m_Pen.DeleteObject();
- m_Brush.DeleteObject();
- HFONT hFont =NULL;
- if(IsWin9x())
- {
- hFont=::CreateFont(15,0,0,0,FW_BOLD,0,0,0,0,0,0,0,0,"");
- }
- else
- {
- hFont=::CreateFont(14,0,0,0,FW_BOLD,0,0,0,0,0,0,0,0,"");
- }
- HFONT hOldFont =(HFONT)::SelectObject(dc.GetSafeHdc(), hFont);
- dc.SetBkMode(TRANSPARENT);
- dc.SetTextColor(RGB(79, 80, 80));
- char buffer[256];
- memset(buffer, 0, sizeof(char) * 256);
- wsprintf(buffer, "IP : 202.183.173.89n位置:北京朝阳区Game High网吧");
- memset(&rect, 0, sizeof(RECT));
- this->GetClientRect(&rect);
- rect.top +=10;
- rect.left +=10;
- dc.DrawText(buffer, strlen(buffer), &rect, DT_VCENTER | DT_WORDBREAK);
- ::SelectObject(dc.GetSafeHdc(), hOldFont);
- ::DeleteObject(hFont);
- hFont =NULL;
- }
- BOOL CShowIpWnd::OnEraseBkgnd(CDC* pDC)
- {
- return TRUE;
- }