資源簡介
VC屏幕找圖源代碼,實現了快速找圖,速度和按鍵精靈不相上下。按鍵精靈里有個FINDPIC()函數,你指定位圖文件,然后在屏幕上查找和這張圖片相同的圖片,返回找到圖形的坐標。實現方法主要是用GetDIBits獲取屏幕的位圖數據,然后讀出要找的bmp圖片,再比較它們的位圖數據……程序在某些特殊的狀態下可能會找不到圖,但那出現的幾率很小了。(當然,要改進的話也非常容易
注:找圖動態鏈接庫FindPic.dll在壓縮包的Release目錄下

代碼片段和文件信息
//?CallDll.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“CallDll.h“
#include?“CallDllDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CCallDllApp
BEGIN_MESSAGE_MAP(CCallDllApp?CWinApp)
//{{AFX_MSG_MAP(CCallDllApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG
ON_COMMAND(ID_HELP?CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CCallDllApp?construction
CCallDllApp::CCallDllApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CCallDllApp?object
CCallDllApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CCallDllApp?initialization
BOOL?CCallDllApp::InitInstance()
{
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
CCallDllDlg?dlg;
m_pMainWnd?=?&dlg;
int?nResponse?=?dlg.DoModal();
if?(nResponse?==?IDOK)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?OK
}
else?if?(nResponse?==?IDCANCEL)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?Cancel
}
//?Since?the?dialog?has?been?closed?return?FALSE?so?that?we?exit?the
//??application?rather?than?start?the?application‘s?message?pump.
return?FALSE;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????822??2010-05-28?23:00??Release\a.bmp
?????文件??????20480??2010-06-09?22:28??Release\CallDll.exe
?????文件???????5632??2010-06-09?22:24??Release\FindPic.dll
?????文件???????1078??2010-06-08?20:12??res\CallDll.ico
?????文件????????399??2010-06-08?20:12??res\CallDll.rc2
?????文件??????35620??2010-06-09?22:28??CallDll.aps
?????文件???????1062??2010-06-09?22:28??CallDll.clw
?????文件???????2077??2010-06-08?20:12??CallDll.cpp
?????文件???????4177??2010-06-08?20:12??CallDll.dsp
?????文件????????522??2010-06-08?20:14??CallDll.dsw
?????文件???????1335??2010-06-08?20:12??CallDll.h
?????文件??????58368??2010-06-09?22:28??CallDll.ncb
?????文件??????48640??2010-06-09?22:28??CallDll.opt
?????文件????????702??2010-06-09?22:28??CallDll.plg
?????文件???????5303??2010-06-09?22:28??CallDll.rc
?????文件???????4832??2010-06-09?22:26??CallDllDlg.cpp
?????文件???????1373??2010-06-09?21:36??CallDllDlg.h
?????文件??????24576??2010-06-08?21:54??mydll.dll
?????文件???????3597??2010-06-08?20:12??ReadMe.txt
?????文件????????536??2010-06-08?20:12??Resource.h
?????文件????????209??2010-06-08?20:12??StdAfx.cpp
?????文件???????1054??2010-06-08?20:12??StdAfx.h
?????目錄??????????0??2010-06-09?22:29??Debug
?????目錄??????????0??2010-06-09?22:30??Release
?????目錄??????????0??2010-06-08?20:12??res
-----------?---------??----------?-----??----
???????????????222394????????????????????25
評論
共有 條評論