CODE:function sendtext2(string str1, win w)
{
int len=size(str1);
char arr[1023];
char rus[63];
string alfa;
strcpy(#arr[0], str1);
int i=0;
int i2=0;
int n=0;
alfa="F<DULT;PBQRKVYJGHCNEA{WXIO}SM >Z";
strcpy(#rus[0], alfa);
rus[1]=188;
rus[6]=186;
rus[21]=219;
rus[26]=221;
rus[29]=222;
rus[30]=190;
char state[256];
external(INT, "SetKeyboardState", "SetKeyboardState", "User32.dll");
external(INT, "GetKeyboardState", "GetKeyboardState", "User32.dll");
for(i=0;i<len;i++)
{
i2=formatci(arr[i]);
if(i2==32) {attach(w,1); postmessage(WM_KEYDOWN, 32, 1, w); attach(w,0);}
//БОЛЬШАЯ
if (i2>=65)
{
if (i2<=90)
{
sendlanguage("00000409", w);
sleep(100);
attach(w,1);
for (n=0; n<256; n++)state[n]=0;
GetKeyboardState(address(#state[0]);
state[16]=128;
postmessage(WM_KEYDOWN, 16, 1, w);
SetKeyboardState(address(#state[0]);
postmessage(WM_KEYDOWN, i2, 1, w);
sleep(100);
postmessage(WM_KEYUP, i2, 3221225472, w);
postmessage(WM_KEYUP, 16, 3221225472, w);
state[16]=0;
SetKeyboardState(address(#state[0]);
attach(w,0);
}
}
//маленькая
if (i2>=97)
{
if(i2<=122)
{i2=i2-32;
sendlanguage("00000409", w);
sleep(100);
postmessage(WM_KEYDOWN, i2, 1, w);
sleep(100);
postmessage(WM_KEYUP, i2, 3221225472, w);
}
}
//БОЛЬШАЯ РУС
if (i2>=192)
{
if (i2<=223)
{
sendlanguage("00000419", w);
sleep(100);
i2=i2-192;
i2=formatci(rus[i2]);
attach(w,1);
for (n=0; n<256; n++)state[n]=0;
GetKeyboardState(address(#state[0]);
state[16]=128;
postmessage(WM_KEYDOWN, 16, 1, w);
SetKeyboardState(address(#state[0]);
postmessage(WM_KEYDOWN, i2, 1, w);
sleep(100);
postmessage(WM_KEYUP, i2, 3221225472, w);
postmessage(WM_KEYUP, 16, 3221225472, w);
state[16]=0;
SetKeyboardState(address(#state[0]);
attach(w,0);
}
}
//маленькая рус
if (i2>=224)
{
if (i2<=255)
{
i2=i2-224;
i2=formatci(rus[i2]);
sendlanguage("00000419", w);
sleep(100);
postmessage(WM_KEYDOWN, i2, 1, w);
sleep(100);
postmessage(WM_KEYUP, i2, 3221225472, w);
}
}
}
}