📄 syslongon.cpp
字号:
// SYSLONGON.cpp : implementation file
//
#include "stdafx.h"
#include "EasyTrade.h"
#include "SYSLONGON.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define AW_HOR_POSITIVE 0x00000001
#define AW_HOR_NEGATIVE 0x00000002
#define AW_VER_POSITIVE 0x00000004
#define AW_VER_NEGATIVE 0x00000008
#define AW_CENTER 0x00000010
#define AW_HIDE 0x00010000
#define AW_ACTIVATE 0x00020000
#define AW_SLIDE 0x00040000
#define AW_BLEND 0x00080000
/////////////////////////////////////////////////////////////////////////////
// CSYSLONGON dialog
CSYSLONGON::CSYSLONGON(CWnd* pParent /*=NULL*/)
: CDialog(CSYSLONGON::IDD, pParent)
{
//{{AFX_DATA_INIT(CSYSLONGON)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CSYSLONGON::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSYSLONGON)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSYSLONGON, CDialog)
//{{AFX_MSG_MAP(CSYSLONGON)
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSYSLONGON message handlers
BOOL CSYSLONGON::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
char* lpRand=new char[10];
srand( (unsigned)time( NULL ) );
int nRand=rand();
itoa(nRand,lpRand,10);
int nLen=strlen(lpRand);
strcpy(lpRand,&lpRand[nLen-1]);
if(atoi(lpRand)<5) //随机产生两种动态效果之一
dwStyle=AW_BLEND;
else
dwStyle=AW_CENTER;
delete lpRand;
CRect rcWnd,rcNew;
this->GetWindowRect(&rcWnd);
//定位窗口位置
int nXScreen=::GetSystemMetrics(SM_CXSCREEN);
int nYScreen=::GetSystemMetrics(SM_CYSCREEN);
int TitBarHeight=::GetSystemMetrics(SM_CYSIZE);
rcNew.left=nXScreen/2-rcWnd.Width()/2;
rcNew.top=nYScreen/2-rcWnd.Height()/2+TitBarHeight;
rcNew.right=rcNew.left+rcWnd.Width();
rcNew.bottom=rcNew.top+rcWnd.Height();
this->MoveWindow(rcNew);
// TODO: Add extra initialization here
HINSTANCE hInst=LoadLibrary("User32.DLL");
typedef BOOL(WINAPI MYFUNC(HWND,DWORD,DWORD));
MYFUNC* AnimateWindow;
AnimateWindow=(MYFUNC *)::GetProcAddress(hInst,"AnimateWindow");
AnimateWindow(this->GetSafeHwnd(),700,dwStyle);
FreeLibrary(hInst);
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
this->Invalidate();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSYSLONGON::OnOK() //查找用户与密码
{
// TODO: Add extra validation here
CDialog::OnOK();
}
void CSYSLONGON::OnCancel()
{
HINSTANCE hInst=LoadLibrary("User32.DLL");
typedef BOOL(WINAPI MYFUNC(HWND,DWORD,DWORD));
MYFUNC* AnimateWindow;
AnimateWindow=(MYFUNC *)::GetProcAddress(hInst,"AnimateWindow");
AnimateWindow(this->GetSafeHwnd(),700,AW_HIDE|dwStyle);
FreeLibrary(hInst);
CDialog::OnCancel();
}
void CSYSLONGON::OnButexit()
{
this->OnCancel();
}
void CSYSLONGON::OnClose()
{
// TODO: Add your message handler code here and/or call default
CDialog::OnClose();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -