[AppleScript] 纯文本查看 复制代码
#include "stdafx.h"
#include "resource.h"
#include <stdio.h>
#include "QQ美女找茬外挂源码.h"
#define ID_TIMER 1
#define MAX_LOADSTRING 100
//////////////////////变量,对象/////////////////////////////////////////////
POINT left1,right1;
int height1,width1;
int cxSize,cySize;
HDC hdcMem;
HBITMAP hBitmap;
POINT pt;
TCHAR szString[] = TEXT ("大家好!!!, 我是Tortoiser -_- ~~~") ;
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
///声明函数
///////////////////////////////////////////////////////////////
BOOL CALLBACK DlgProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam);
BOOL CALLBACK AboutDlgProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam);
void CALLBACK TimerProc(HWND hwnd,UINT message,UINT iTimerID,DWORD dwTime);
LRESULT CALLBACK WinProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // command line
int iCmdShow // show state
)
{
static TCHAR szAppName[] = TEXT ("QQ美女找茬外挂") ;
WNDCLASS wndclass;
HWND hwnd;
MSG msg;
wndclass.cbClsExtra=0; //默认
wndclass.cbWndExtra=0; //默认
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW); //默认
wndclass.hIcon=LoadIcon(hInstance,szAppName);
wndclass.hInstance=hInstance; //默认
wndclass.lpfnWndProc=WinProc;
wndclass.lpszClassName=szAppName;
wndclass.lpszMenuName= MAKEINTRESOURCE(IDC_QQ);
wndclass.style=CS_HREDRAW | CS_VREDRAW; //默认
if (!RegisterClass (&wndclass))
{
MessageBox (NULL, TEXT ("This program requires Windows NT!"),szAppName, MB_ICONERROR) ;
return 0 ;
}
hwnd=CreateWindow( szAppName,
szAppName,
WS_OVERLAPPEDWINDOW,
0,
0,
500,
400,
NULL,
LoadMenu(hInstance,MAKEINTRESOURCE(IDC_QQ)),
hInstance,
NULL);
ShowWindow(hwnd,iCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WinProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
)
{
TCHAR szAppName[] = TEXT ("QQ美女找茬外挂") ;
static HINSTANCE hInstance;
static count = 0;
static flag = 0;
HDC hdc_me,hdc;//依次为窗口设备描述表,桌面DC
PAINTSTRUCT ps;
HWND desk_hwnd = GetDesktopWindow();
switch(uMsg)
{
case WM_CREATE:
left1.x = 175;
left1.y = 189;
right1.x = 683;
right1.y = 189;
cxSize = GetSystemMetrics(SM_CXSCREEN);
cySize = GetSystemMetrics(SM_CYSCREEN);
width1 = cxSize/2;
height1 = cySize;
hInstance = ((LPCREATESTRUCT)lParam)->hInstance;
RegisterHotKey(hwnd,100,0,VK_F4);
SetWindowPos(hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDM_SET:
DialogBox(hInstance,(LPCTSTR)IDD_DIALOG1,hwnd,(DLGPROC)DlgProc);
// if(DialogBox(hInstance,TEXT("SCR_COPY"),hwnd,DlgProc))
// InvalidateRect(hwnd,NULL,TRUE);
return 0;
case IDM_CUT:
MoveWindow(hwnd,cxSize/2,0,width1-left1.x-1,height1-125,TRUE); //窗口移到右边
Sleep(200); //稍等一下
hdc_me = GetDC(hwnd);
hdcMem = CreateCompatibleDC(hdc_me); //内存设备描述表,该函数创建一个与指定设备兼容的内存设备上下文环境(DC)。
//如果成功,则返回内存设备上下文环境的句柄;如果失败,则返回值为NULL。
if(hBitmap)
{
DeleteObject(hBitmap);
hBitmap = NULL;
}
hBitmap = CreateCompatibleBitmap(hdc_me,width1-1,height1); //该函数创建与指定的设备环境相关的设备兼容的位图。
SelectObject(hdcMem,hBitmap); //该函数选择一对象到指定的设备上下文环境中,该新对象替换先前的相同类型的对象。
hdc = GetDCEx(desk_hwnd,0,DCX_LOCKWINDOWUPDATE); //该函数检索指定窗口客户区域或整个屏幕的显示设备上下文环境的句柄
pt = left1;
ScreenToClient(hwnd,&pt);
BitBlt(hdcMem,0,0,width1-1,height1,hdc,left1.x,left1.y,SRCCOPY);//桌面左边图像放入内存
MoveWindow(hwnd,left1.x,0,width1-left1.x-1,height1-125,TRUE); //窗口移到左边
Sleep(200);
//右边图像放入内存并进行异或操作
BitBlt(hdcMem,0,0,width1-left1.x,height1-125,hdc,right1.x+1,right1.y,SRCINVERT);//这句就是关键的一句算法,求异或操作
if(flag)
KillTimer(hwnd,ID_TIMER);
flag = 1;
SetTimer(hwnd,ID_TIMER,50,TimerProc);
ReleaseDC(hwnd,hdc_me);
ReleaseDC(desk_hwnd,hdc);
return 0;
case IDM_ABOUT:
DialogBox(hInstance,(LPCTSTR)IDD_ABOUTBOX,hwnd,(DLGPROC)AboutDlgProc);
return 0;
}
break;
case WM_PAINT:
hdc = BeginPaint (hwnd, &ps) ;
TextOut(hdc,50,50,szString,lstrlen(szString));
EndPaint (hwnd, &ps) ;
return 0 ;
case WM_HOTKEY:
if(IsWindowVisible(hwnd))
ShowWindow(hwnd,SW_HIDE);
else
ShowWindow(hwnd,SW_SHOW);
SendMessage(hwnd,WM_COMMAND,IDM_CUT,0);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd,uMsg,wParam,lParam);
}
return 0;
}
///////////////////////////////////////////////////////////////////
BOOL CALLBACK DlgProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
SetDlgItemInt(hDlg,IDC_L_X,left1.x,0);
SetDlgItemInt(hDlg,IDC_L_Y,left1.y,0);
SetDlgItemInt(hDlg,IDC_R_X,right1.x,0);
SetDlgItemInt(hDlg,IDC_R_Y,right1.y,0);
SetDlgItemInt(hDlg,IDC_HEIGHT,height1,0);
SetDlgItemInt(hDlg,IDC_WIDTH, width1,0);
return 0;
case WM_CLOSE:
EndDialog(hDlg,FALSE);
return 0;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
left1.x = GetDlgItemInt(hDlg,IDC_L_X,NULL,0);
left1.y = GetDlgItemInt(hDlg,IDC_L_Y,NULL,0);
right1.x = GetDlgItemInt(hDlg,IDC_R_X,NULL,0);
right1.y = GetDlgItemInt(hDlg,IDC_R_Y,NULL,0);
height1 = GetDlgItemInt(hDlg,IDC_HEIGHT,NULL,0);
width1 = GetDlgItemInt(hDlg,IDC_WIDTH,NULL,0);
EndDialog(hDlg,TRUE);
return TRUE;
}
}
return 0;
}
///////////////////////////////////////////////////////////////////
BOOL CALLBACK AboutDlgProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}
///////////////////////////////////////////////////////////////////
void CALLBACK TimerProc(HWND hwnd,UINT message,UINT iTimerID,DWORD dwTime)
{
HDC hdc_me = GetDC(hwnd);
POINT pos,pos2;
HBRUSH hBrush;
BitBlt(hdc_me,0,pt.y,width1-1,height1,hdcMem,0,0,SRCCOPY);
hBrush = CreateSolidBrush(RGB(255,100,255));
SelectObject(hdc_me,hBrush);
GetCursorPos(&pos);
pos2 = pos;
ScreenToClient(hwnd,&pos2);
Ellipse(hdc_me,pos.x-cxSize/2-5,pos2.y-5,pos.x-cxSize/2+5,pos2.y+5);
DeleteObject(hBrush);
ReleaseDC(hwnd,hdc_me);
}