VC6中创建一个MFC命令行工程,可以直接编译,懂的,可以拿来用。
#include "stdafx.h"
#include "MediaCoder注册机.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CWinApp theApp;
using namespace std;
int ok=0;
typedef struct ENUM_PARAM
{
CTreeCtrl* hTree;
HTREEITEM hParent;
}ENUM_WIN_PARAM;
BOOL __stdcall EnumWindowsProc(HWND hWnd, LPARAM lParam);
BOOL CaptureWindowToClipboard(HWND hWnd);
BOOL __stdcall ChildEnumWindowsProc(HWND hWnd, LPARAM lParam)
{
ENUM_WIN_PARAM* xParam=(ENUM_WIN_PARAM*)lParam;
TV_INSERTSTRUCT TCItem;
TCHAR m_strTitle[MAX_PATH];
TCHAR m_strClass[MAX_PATH];
TCHAR m_strDisplay[MAX_PATH*2+10];
ZeroMemory(&TCItem,sizeof(TV_INSERTSTRUCT));
if(::GetWindowLong(hWnd,GWL_STYLE)& WS_VISIBLE)
{
::GetWindowText(hWnd,m_strTitle,MAX_PATH-1);
if(strstr(m_strTitle,"做一个简单算术题吧"))
{
CString str_title=m_strTitle;
int i_end1=str_title.Find(":",0);//查找:出现的位置
int i_end