rendered paste body#include <windows.h>
#include "resource.h"
HMODULE hThisModule;
char buffer[4];
int GetPixel()
{
HWND hwnd = FindWindow(0, "MapleStory");
HDC hdc = GetDC(hwnd);
COLORREF checkPin = GetPixel(hdc,288,236);
return GetRValue(checkPin);
}
void doMagic(int from, int to)
{
Sleep(6500);
while(from <= to)
{
if (GetPixel() == 93)
{
//SendMessage
}
}
}
BOOL CALLBACK WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
{
switch (uMessage)
{
case WM_COMMAND:
switch( wParam )
{
case IDC_BUTTON1:
GetWindowText(GetDlgItem(hWnd, IDC_EDIT3), buffer, sizeof(buffer));
int from = atoi(buffer);
GetWindowText(GetDlgItem(hWnd, IDC_EDIT4), buffer, sizeof(buffer));
int to = atoi(buffer);
doMagic(from, to);
return TRUE;
}
break;
case WM_CLOSE:
EndDialog(hWnd, 0);
return TRUE;
}
return FALSE;
}
DWORD WINAPI ShowDialog(LPVOID lpParam)
{
return (DWORD)(DWORD_PTR)DialogBox((HMODULE)lpParam,MAKEINTRESOURCE(IDD_DIALOG1), 0, WndProc);
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
hThisModule = hModule;
DisableThreadLibraryCalls(hModule);
switch( ul_reason_for_call )
{
case DLL_PROCESS_ATTACH:
CreateThread(0, 0, &ShowDialog, (LPVOID)hModule, 0, 0);
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}