AboutDlg.cpp
资源名称:CQQFind.rar [点击查看]
上传用户:cxh888fhc
上传日期:2017-07-08
资源大小:240k
文件大小:2k
源码类别:
钩子与API截获
开发平台:
Visual C++
- // AboutDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "CQQFind.h"
- #include "AboutDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CAboutDlg dialog
- CAboutDlg::CAboutDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CAboutDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CAboutDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- void CAboutDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAboutDlg)
- DDX_Control(pDX, IDOK, m_btnOK);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
- //{{AFX_MSG_MAP(CAboutDlg)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CAboutDlg message handlers
- BOOL CAboutDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- m_btnOK.SetDefaultFace();
- m_btnOK.SetDefaultButton(TRUE);
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CAboutDlg::OnOK()
- {
- // TODO: Add extra validation here
- SetWindowLong(m_hWnd,GWL_EXSTYLE,
- GetWindowLong(m_hWnd,GWL_EXSTYLE)|0x80000);
- HINSTANCE hInst = LoadLibrary("User32.DLL");
- if(hInst)
- {
- typedef BOOL (WINAPI *MYFUNC)(HWND,COLORREF,BYTE,DWORD);
- MYFUNC fun = NULL;
- fun=(MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes");
- if(fun)
- {
- int i=255*3;
- {
- while(i--)
- {
- MSG msg;
- while(PeekMessage(&msg,m_hWnd,0,0,PM_REMOVE))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- fun(m_hWnd,0,i/3,2);
- }
- }
- }
- FreeLibrary(hInst);
- }
- CDialog::OnOK();
- }