Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengChengCC committed Mar 6, 2016
1 parent d67123a commit 7edac37
Show file tree
Hide file tree
Showing 252 changed files with 33,010 additions and 0 deletions.
44 changes: 44 additions & 0 deletions arkProject/HeavenShadow/HeavenShadow.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HeavenShadow", "HeavenShadow\HeavenShadow.vcxproj", "{A8649B59-9CD1-4E45-A2EE-C390FFFCB8A0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "injectdll64", "injectdll64\injectdll64.vcxproj", "{F7C83834-3D4A-4362-9E7B-5EE1F4D68C89}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "injectdll32", "injectdll32\injectdll32.vcxproj", "{53E8A28F-7458-42B6-9AFA-200CBCC48221}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A8649B59-9CD1-4E45-A2EE-C390FFFCB8A0}.Debug|Win32.ActiveCfg = Debug|Win32
{A8649B59-9CD1-4E45-A2EE-C390FFFCB8A0}.Debug|Win32.Build.0 = Debug|Win32
{A8649B59-9CD1-4E45-A2EE-C390FFFCB8A0}.Debug|x64.ActiveCfg = Debug|x64
{A8649B59-9CD1-4E45-A2EE-C390FFFCB8A0}.Debug|x64.Build.0 = Debug|x64
{A8649B59-9CD1-4E45-A2EE-C390FFFCB8A0}.Release|Win32.ActiveCfg = Release|Win32
{A8649B59-9CD1-4E45-A2EE-C390FFFCB8A0}.Release|Win32.Build.0 = Release|Win32
{A8649B59-9CD1-4E45-A2EE-C390FFFCB8A0}.Release|x64.ActiveCfg = Release|x64
{A8649B59-9CD1-4E45-A2EE-C390FFFCB8A0}.Release|x64.Build.0 = Release|x64
{F7C83834-3D4A-4362-9E7B-5EE1F4D68C89}.Debug|Win32.ActiveCfg = Debug|x64
{F7C83834-3D4A-4362-9E7B-5EE1F4D68C89}.Debug|Win32.Build.0 = Debug|x64
{F7C83834-3D4A-4362-9E7B-5EE1F4D68C89}.Debug|x64.ActiveCfg = Debug|x64
{F7C83834-3D4A-4362-9E7B-5EE1F4D68C89}.Debug|x64.Build.0 = Debug|x64
{F7C83834-3D4A-4362-9E7B-5EE1F4D68C89}.Release|Win32.ActiveCfg = Release|Win32
{F7C83834-3D4A-4362-9E7B-5EE1F4D68C89}.Release|Win32.Build.0 = Release|Win32
{F7C83834-3D4A-4362-9E7B-5EE1F4D68C89}.Release|x64.ActiveCfg = Release|Win32
{53E8A28F-7458-42B6-9AFA-200CBCC48221}.Debug|Win32.ActiveCfg = Debug|Win32
{53E8A28F-7458-42B6-9AFA-200CBCC48221}.Debug|Win32.Build.0 = Debug|Win32
{53E8A28F-7458-42B6-9AFA-200CBCC48221}.Debug|x64.ActiveCfg = Debug|Win32
{53E8A28F-7458-42B6-9AFA-200CBCC48221}.Debug|x64.Build.0 = Debug|Win32
{53E8A28F-7458-42B6-9AFA-200CBCC48221}.Release|Win32.ActiveCfg = Release|Win32
{53E8A28F-7458-42B6-9AFA-200CBCC48221}.Release|Win32.Build.0 = Release|Win32
{53E8A28F-7458-42B6-9AFA-200CBCC48221}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added arkProject/HeavenShadow/HeavenShadow.suo
Binary file not shown.
298 changes: 298 additions & 0 deletions arkProject/HeavenShadow/HeavenShadow/AlertWnd.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
// AlertWnd.cpp : 实现文件
//

#include "stdafx.h"
#include "HeavenShadow.h"
#include "AlertWnd.h"
#include "afxdialogex.h"


#include <Mmsystem.h>


// CAlertWnd 对话框

IMPLEMENT_DYNAMIC(CAlertWnd, CDialog)

CAlertWnd::CAlertWnd(CWnd* pParent /*=NULL*/)
: CDialog(CAlertWnd::IDD, pParent)
{
m_ulCount = 20;
m_TimerTip = _T("");
}

CAlertWnd::~CAlertWnd()
{
}

void CAlertWnd::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_STATIC_TIMERTIP, m_TimerTip);
DDX_Control(pDX, IDC_STATIC_BTN_ALLOW, m_btnAllow);
DDX_Control(pDX, IDC_STATIC_BTN_PREVENT, m_btnPrevent);
DDX_Control(pDX, IDC_STATIC_TIMERTIP, m_TextTimer);
DDX_Control(pDX, IDC_STATIC_ALERT_CONTEXT, m_TextContext);
DDX_Control(pDX, IDC_STATIC_ALERT_TITLE, m_TextTitle);
}


BEGIN_MESSAGE_MAP(CAlertWnd, CDialog)
ON_WM_CLOSE()
ON_WM_PAINT()
ON_WM_SHOWWINDOW()
ON_WM_CTLCOLOR()
// ON_STN_CLICKED(IDC_STATIC_ALERTBTNEXIT, &CAlertWnd::OnStnClickedStaticAlertbtnexit)
ON_WM_TIMER()
ON_STN_CLICKED(IDC_STATIC_BTN_PREVENT, &CAlertWnd::OnStnClickedStaticBtnPrevent)
ON_STN_CLICKED(IDC_STATIC_BTN_ALLOW, &CAlertWnd::OnStnClickedStaticBtnAllow)
ON_WM_SYSCOMMAND()
ON_WM_SIZE()
END_MESSAGE_MAP()


// CAlertWnd 消息处理程序






BOOL CAlertWnd::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: 在此添加额外的初始化

ModifyStyleEx(WS_EX_APPWINDOW,WS_EX_TOOLWINDOW);//设置扩展工具窗模式。阻止任务栏显示图标

m_ulCount = 20;

m_TimerTip.Format(L"将执行阻止操作: %2d 秒 ",m_ulCount);

UpdateData(FALSE);

//获得桌面大小
CRect rectWorkArea;
SystemParametersInfoW(SPI_GETWORKAREA,0,&rectWorkArea,SPIF_SENDCHANGE);

//获得对话框大小
CRect rectDlg;
GetWindowRect(&rectDlg);
int nW = rectDlg.Width();
int nH = rectDlg.Height();

//将窗口设置到右下脚
::SetWindowPos(this->m_hWnd,HWND_BOTTOM,
rectWorkArea.right-nW-6,rectWorkArea.bottom-nH,
nW,nH,
SWP_NOZORDER);

//动画显示
//AnimateWindow(150,AW_CENTER|AW_ACTIVATE|AW_VER_NEGATIVE);
//AnimateWindow(200,AW_SLIDE|AW_ACTIVATE|AW_VER_NEGATIVE);//
//AnimateWindow(150,AW_BLEND|AW_ACTIVATE|AW_VER_NEGATIVE);




CloseHandle(CreateThread(NULL,0,
(LPTHREAD_START_ROUTINE)HsPlayAlertSound,NULL, 0,NULL));


SetTimer(3333,1000,NULL);





return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}


BOOL CAlertWnd::PreTranslateMessage(MSG* pMsg)
{
// TODO: 在此添加专用代码和/或调用基类

if(pMsg->message==WM_KEYDOWN && (pMsg->wParam==VK_RETURN ||pMsg->wParam==VK_ESCAPE))
{
return TRUE;
}

return CDialog::PreTranslateMessage(pMsg);
}


void CAlertWnd::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: 在此处添加消息处理程序代码
// 不为绘图消息调用 CDialog::OnPaint()

CRect rect;
GetClientRect(rect);
dc.FillSolidRect(rect,RGB(0,116,179));
}


void CAlertWnd::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);

// TODO: 在此处添加消息处理程序代码

if (bShow == TRUE)
{
}
}

void CAlertWnd::OnClose()
{
// TODO: 在此添加消息处理程序代码和/或调用默认值

//动画显示
//AnimateWindow(150,AW_CENTER|AW_HIDE|AW_VER_POSITIVE);
//AnimateWindow(200,AW_SLIDE|AW_HIDE|AW_VER_POSITIVE);//AW_SLIDE|
//AnimateWindow(150,AW_BLEND|AW_HIDE|AW_VER_POSITIVE);

CDialog::OnClose();
}


HBRUSH CAlertWnd::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

// TODO: 在此更改 DC 的任何特性

if ( nCtlColor == CTLCOLOR_BTN)
{
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)::GetStockObject(NULL_BRUSH);

}

// if ( nCtlColor == CTLCOLOR_STATIC|| nCtlColor == CTLCOLOR_BTN|| nCtlColor == CTLCOLOR_MAX )
// {
// //pDC->SetBkColor(RGB(232,80,80));
//
// pDC->SetBkMode(TRANSPARENT);
//
// pDC->SetTextColor(RGB(255,255,255));
//
// // TODO: 如果默认的不是所需画笔,则返回另一个画笔
// return (HBRUSH)::GetStockObject(NULL_BRUSH);
// }

return hbr;
}


void CAlertWnd::OnOK()
{
// TODO: 在此添加专用代码和/或调用基类

CDialog::OnOK();
}


void CAlertWnd::OnCancel()
{
// TODO: 在此添加专用代码和/或调用基类

CDialog::OnCancel();
}


//void CAlertWnd::OnStnClickedStaticAlertbtnexit()
//{
// // TODO: 在此添加控件通知处理程序代码
// SendMessage(WM_CLOSE);
//}


void CAlertWnd::OnTimer(UINT_PTR nIDEvent)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值

switch(nIDEvent)
{
case 3333:
{
if (m_ulCount == 0)
{
KillTimer(3333);
SendMessage(WM_CLOSE);
}
m_ulCount--;


m_TimerTip.Format(L"将执行阻止操作: %2d 秒",m_ulCount);

UpdateData(FALSE);

SendMessage(WM_PAINT);
}
}

CDialog::OnTimer(nIDEvent);
}


void HsPlayAlertSound(void)
{
::PlaySoundW(MAKEINTRESOURCE(IDR_WAVE_SYSTEM_ALERT), ::GetModuleHandle(NULL), SND_RESOURCE | SND_SYNC);

}


void CAlertWnd::OnStnClickedStaticBtnPrevent()
{
// TODO: 在此添加控件通知处理程序代码
HINSTANCE hIns = AfxFindResourceHandle(MAKEINTRESOURCE(IDB_BITMAP_BTN_PREVENT_C),RT_GROUP_ICON);

HBITMAP hBmp = ::LoadBitmap(hIns, MAKEINTRESOURCE(IDB_BITMAP_BTN_PREVENT_C));

m_btnPrevent.SetBitmap(hBmp);

Sleep(100);

SendMessage(WM_CLOSE);
}


void CAlertWnd::OnStnClickedStaticBtnAllow()
{
// TODO: 在此添加控件通知处理程序代码
HINSTANCE hIns = AfxFindResourceHandle(MAKEINTRESOURCE(IDB_BITMAP_BTN_ALLOW_C),RT_GROUP_ICON);

HBITMAP hBmp = ::LoadBitmap(hIns, MAKEINTRESOURCE(IDB_BITMAP_BTN_ALLOW_C));

m_btnAllow.SetBitmap(hBmp);

Sleep(100);

SendMessage(WM_CLOSE);
}


void CAlertWnd::OnSysCommand(UINT nID, LPARAM lParam)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值

CDialog::OnSysCommand(nID, lParam);
}


void CAlertWnd::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);

// TODO: 在此处添加消息处理程序代码

if (SIZE_MINIMIZED==nType)
{
ShowWindow(TRUE);
}
}
51 changes: 51 additions & 0 deletions arkProject/HeavenShadow/HeavenShadow/AlertWnd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#pragma once

#include "MyPicButton.h"

#include "MyText.h"
#include "afxwin.h"

// CAlertWnd 对话框

class CAlertWnd : public CDialog
{
DECLARE_DYNAMIC(CAlertWnd)

public:
CAlertWnd(CWnd* pParent = NULL); // 标准构造函数
virtual ~CAlertWnd();

// 对话框数据
enum { IDD = IDD_DIALOG_ALERT };

ULONG m_ulCount;

protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持

DECLARE_MESSAGE_MAP()
public:
afx_msg void OnClose();
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnPaint();
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
virtual void OnOK();
virtual void OnCancel();
// afx_msg void OnStnClickedStaticAlertbtnexit();
afx_msg void OnTimer(UINT_PTR nIDEvent);
CString m_TimerTip;
afx_msg void OnStnClickedStaticBtnPrevent();
afx_msg void OnStnClickedStaticBtnAllow();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnSize(UINT nType, int cx, int cy);
CMyPicButton m_btnAllow;
CMyPicButton m_btnPrevent;
CMyText m_TextTimer;
CMyText m_TextContext;
CMyText m_TextTitle;
};


void HsPlayAlertSound(void);
Loading

0 comments on commit 7edac37

Please sign in to comment.