void WriteCommandToConsole(string Command)
{
HWND hwnd = FindWindow(NULL,L"aIW Console");
HWND childHwnd = FindWindowEx(hwnd,NULL,L"Edit",NULL);
const int Lenght = Command.length();
char cCommand[Lenght];
for(int i = 0; i < Command.size();i++)
{
cCommand[i] = Command.at(i);
}
for(int i = 0,inInt; i < Command.size(); i++)
{
inInt = cCommand[i];
SendMessage(childHwnd,WM_CHAR,inInt,true);
}
SendMessage(childHwnd,WM_CHAR,VK_RETURN,true);
}
WriteCommandToConsole("cg_drawFps 1");

void SendCommand(LPCTSTR Command)
{
static HWND editBox = FindWindowEx(FindWindow(NULL, L"aIW Console"),0,L"Edit",0);
if(editBox == NULL)
return;
else
{
SendMessage(editBox,WM_SETTEXT,0,(LPARAM)((LPCTSTR)Command));
SendMessage(editBox,WM_CHAR,VK_RETURN,0);
}
}

void WriteCommandToConsole(string Command)
{
static HWND childHwnd = FindWindowEx(FindWindow(NULL,L"aIW Console"),NULL,L"Edit",NULL);
short length = Command.length();
for(short i = 0; i < length; ++i)
{
SendMessage(childHwnd,WM_CHAR,(int)Command.at(i),true);
}
SendMessage(childHwnd,WM_CHAR,VK_RETURN,true);
}
void WriteCommandToConsole(string Command)
{
static HWND childHwnd = FindWindowEx(FindWindow(NULL,L"aIW Console"),NULL,L"Edit",NULL);
if(childHwnd == NULL)
{
childHwnd = FindWindowEx(FindWindow(NULL,L"aIW Console"),NULL,L"Edit",NULL);
if(childHwnd == NULL)
return;
}
short length = Command.length();
for(short i = 0; i < length; ++i)
{
SendMessage(childHwnd,WM_CHAR,(int)Command.at(i),true);
}
SendMessage(childHwnd,WM_CHAR,VK_RETURN,true);
}
void SendCommand(LPCTSTR Command)
{
static HWND editBox = FindWindowEx(FindWindow(NULL, L"aIW Console"),0,L"Edit",0);
if(editBox == NULL)
return;
else
{
SendMessage(editBox,WM_SETTEXT,0,(LPARAM)((LPCTSTR)Command));
SendMessage(editBox,WM_CHAR,VK_RETURN,0);
}
}
