1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| char* wpurl = new char[500];
int len;
wchar_t *wText1;
wchar_t *wText2;
wchar_t *wText3;
// 1
sprintf_s(wpurl,500,"open");
len = strlen(wpurl)+1;
wText1 = new wchar_t[len];
::MultiByteToWideChar(CP_ACP, NULL,wpurl, -1, wText1,len);
// 2
sprintf_s(wpurl,500,"firefox.exe");
len = strlen(wpurl)+1;
wText2 = new wchar_t[len];
::MultiByteToWideChar(CP_ACP, NULL,wpurl, -1, wText2,len);
// 3
sprintf_s(wpurl,500,"www.google.fr");
len = strlen(wpurl)+1;
wText3 = new wchar_t[len];
::MultiByteToWideChar(CP_ACP, NULL,wpurl, -1, wText3,len);
for(i=0;i<1;i++)
{
ShellExecute(NULL,wText1,wText2,wText3,NULL,SW_SHOWNORMAL);
Sleep(5000);
for(j=0;j<39;j++)
{
SendKeys::SendWait( "{TAB}" );
Sleep(500);
}
} |
Partager