Im making a program to login to a online game and play for you but i need to be able to somehow 'Read the symbols on the picture' and type them in is there any way to do this?Code:#include <windows.h>
#include <iostream>
#include "resource.h"
using namespace std;
char userName [256];
char userPassword [256];
bool Login = false;
bool Probing = true;
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch (message)
{
case WM_CLOSE:
EndDialog(hwnd,true);
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_BUTTON10:
EndDialog(hwnd,true);
break;
case IDC_BUTTON9:
GetDlgItemText(hwnd,IDC_EDIT1,userName,200);
GetDlgItemText(hwnd,IDC_EDIT2,userPassword,200);
ShowWindow(hwnd,SW_MINIMIZE); // start and minimize
Sleep(2000);
HINSTANCE open = ShellExecute(HWND_DESKTOP,"open","www.fatelords.com/login.php",NULL,NULL,SW_SHOWNORMAL);
if (!Login)
{
Sleep(15000); // allow time for page to load
// i have a slow connection to the server
// so i made it 15 seconds
for(int j=0; j < 13; j++)
{
keybd_event(VK_TAB,1,0,0);
keybd_event(VK_TAB,1,KEYEVENTF_KEYUP,0);
}
for (int i=0; i<strlen(userName); i++)
{
if (userName[i] == '@')
{
keybd_event(VK_SHIFT,1,0,0);
keybd_event(VkKeyScan('2'),1,0,0); // stimulate '@'
keybd_event(VK_SHIFT,1,KEYEVENTF_KEYUP,0);
}
else
{
keybd_event(VkKeyScan(userName[i]),1.0,0,0);
}
}
// End username Login
keybd_event(VK_TAB,1,0,0);
keybd_event(VK_TAB,1,KEYEVENTF_KEYUP,0);
for (int i=0; i<strlen(userPassword); i++)
{
keybd_event(VkKeyScan(userPassword[i]),1,0,0);
}
keybd_event(VK_RETURN,1,0,0); // 'Enter' button
Login = true;
} // end login part
break;
}
break;
}
return false;
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,
LPSTR lpCmdLine,int nCmdShow)
{
DialogBox(hInstance,MAKEINTRESOURCE(IDD_DIALOG1),NULL,DLGPROC(WndProc));
return true;
}