# Help with complex program

Show 80 post(s) from this thread on one page
Page 1 of 2 12 Last
• 04-25-2005
Olidivera
Help with complex program
I am in need of a program. I am not sure how to program such a thing, so I'll ask for help. :p

1. I need to make this program calculate the total number of possible combinations of letters and/or numbers in an entered amount of digits. (example: entered 1 digit for numbers only and you get: 10. Enter two digits for numbers only and get: 100. ect.) There must be some sort of formula, but I am not sure what it is.

2. Is is possible with C++ to have this program make the mouse click at specified x,y and to have the program type in text and deleate text? If so, then how would I go about doing this? If no, then what language could accomplish this?
• 04-25-2005
7stud
1.
Quote:

(example: entered 1 digit for numbers only and you get: 10.
10^1

Quote:

Enter two digits for numbers only and get: 100. ect.)
10^2

It's generally refered to as a the "decimal number system" or "base 10". "dec" in "decimal" means 10.

2. I'm sure it's possible with C++. One way: get "Ivor Horton's Beginning Visual C++" which will teach you C++ and then windows programming with MS VC++. It's about 1,000 pages long.
• 04-25-2005
Olidivera
Quote:

Originally Posted by 7stud
10^1

10^2

It's generally refered to as a the "decimal number system" or "base 10". "dec" in "decimal" means 10.

Yes I'm sure that works....but what is the formula for adding in letters? (lowercase only)
• 04-25-2005
7stud
How many letters are in the alphabet?
• 04-25-2005
Zach L.
Lets say you have n possible letters/numbers/symbols.

For one place, you have n possible combinations.
For two places, you have n choices for the first one, and then you have n choices for the second (for each choice of the first) yielding n*n = n^2 possible combinations.

You should be able to extrapolate from there.
• 04-25-2005
7stud
Quote:

You should be able to extrapolate from there.
....not quite.

edit: well, never mind. :)
• 04-25-2005
Olidivera
Therefore, it must be 36^#of spaces I believe.
Well that parts done...

Ok, so what I am trying to do is:

Create a program which finds out all the possible combinations for the entered number of spaces. Then I want to make it so you can specify an x,y coordinate for the mouse to click, what it types in, and what it deleates. Once that is set up, you enter the time it takes between the click to the time of the next typing (to explain that I want it to type in something, then click at a spot, then deleate what it was typing, and then type another thing, and repeat). Then, the program clicks on the designated places, and types in all of the possible combinations (see beginning) one by one. The program should also have a pause and resume button, so you can pause it whenever you wish (possibly even save your process).

I believe that that should be doable. If you do not understand something fully, feel free to ask.
• 04-25-2005
Quantum1024
The second part is operating system dependant. In Microsoft Windows I think you could use WindowFromPoint followed by sending WM_SETTEXT to the returned handle with SendMessage.
• 04-27-2005
Olidivera
does anyone know how i could program this?
• 04-28-2005
Salem
Yes, but we're not here to hand it over on a plate for you.

It's up to you to make the first move, post what you can achieve and then we help you along the way.
• 04-28-2005
Olidivera
Quote:

Originally Posted by Salem
Yes, but we're not here to hand it over on a plate for you.

It's up to you to make the first move, post what you can achieve and then we help you along the way.

Yeah i guess your right. I'm planning to do everything except clicking, typing and deleating in the next week or so, once i get some free time :rolleyes: . I am confident that I can do at least that part.
• 04-29-2005
Salem
Well so long as you don't try something dumb like another recent poster ("Please help by midnight"), then there's usually plenty of time for you to try a little bit, get stuck, post a question, get an answer and move on.
• 04-30-2005
Olidivera
So, I am starting with the other nessasary things, but I already ran into a problem...

I wrote the code needed to make a window (I believe), but I keep getting an error I can't figure out.
The Error is:

Code:

```[Linker error] undefined reference to "GetStockObject@4" id returned 1 exit status [Build Error] [windowmenu.exe] Error 1```
I use Dev C++ 4.9.9.2

The code is...

Code:

```#define WIN32_LEAN_AND_MEAN #include <windows.h> #include <windowsx.h> #include <stdio.h> #include <math.h> #define WINDOW_CLASS_NAME "WINCLASS1" HWND main_window_handle = NULL; ////////////////////////////////////// LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {         PAINTSTRUCT ps;         HDC hdc;         switch(msg)         {         case WM_CREATE:         {return(0);} break;         case WM_PAINT:         {hdc=BeginPaint(hwnd,&ps);         EndPaint(hwnd,&ps);         return(0);} break;         case WM_DESTROY:         {PostQuitMessage(0);         return(0);}break;         default:break;         } } ////////////////////////////////////// int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow) {     WNDCLASS winclass;     HWND hwnd;     MSG msg;     winclass.style=CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW;     winclass.lpfnWndProc=WindowProc;     winclass.cbClsExtra=0;     winclass.cbWndExtra=0;     winclass.hInstance=hinstance;     winclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);     winclass.hCursor=LoadCursor(NULL,IDC_ARROW);     winclass.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH);     winclass.lpszMenuName=NULL;     winclass.lpszClassName=WINDOW_CLASS_NAME;     if(!RegisterClass(&winclass))     return(0);     if (!(hwnd=CreateWindow(WINDOW_CLASS_NAME,     "Title",     WS_OVERLAPPEDWINDOW | WS_VISIBLE,     0,0,     320,200,     NULL,     NULL,     hinstance,     NULL)))     return(0);     main_window_handle=hwnd;     while(1)     {       if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))       {         if(msg.message==WM_QUIT) break;         TranslateMessage(&msg);         DispatchMessage(&msg);       }     } }```
That is the code that my C++ book has in it. If you know of a better way to do make a window, feel free to say so.
• 04-30-2005
Olidivera