I need to send keystrokes to a FF window, specifically, they need to go to the SWF app that will be open in that FF window. I have yet to find an effective method to perform this operation. I specifically need to send a char array to the window. Here is the code that will utilize this function (so people don't waste bandwidth saying they won't do homework).
C++
#include <iostream>
#include <string>
#include <stdio.h>
#include"combination.h"
using namespace std;
using namespace stdcomb;
void swap(char* first, char* second)
{
char ch = *second;
*second = *first;
*first = ch;
}
int permute(char* set, int begin, int end)
{
int i;
int range = end - begin;
if (range == 1) {
cout << set << endl;
//I want to send this to FF too
} else {
for(i=0; i<range; i++) {
swap(&set[begin], &set[begin+i]); //initial swap
permute(set, begin+1, end); //recursion
swap(&set[begin], &set[begin+i]); //swap back
}
}
return 0;
}
int main()
{
char n[7];
cout << "Please input the text you want (de)scrambled: ";
cin.getline(n, 7);
char r5[]= {n[0], n[1], n[2], n[3], n[4], n[6]}; //5 charecter possibilites
char r4[]= {n[0], n[1], n[2], n[3], n[6]}; //4 charecter possibilites
char r3[]= {n[0], n[1], n[2], n[6]}; //3 charecter possibilites
char r2[]= {n[0], n[1], n[6]}; //2 charecter possibilites
permute(n, 0, strlen(n));
do
{
permute(r5, 0, strlen(r5));
}
while(next_combination(n,n+6,r5,r5+5));
do
{
permute(r4, 0, strlen(r4));
}
while(next_combination(n,n+6,r4,r4+4));
do
{
permute(r3, 0, strlen(r3));
}
while(next_combination(n,n+6,r3,r3+3));
do
{
permute(r2, 0, strlen(r2));
}
while(next_combination(n,n+6,r2,r2+2));
return 0;
}