# ICE hotkey's



## tech-it-^ (Aug 18, 2006)

Ok,

I heard of this program which lets you assign multiple functions to one key using the proper syntax. The reason I ask this question is because at my college, when we schedule classes, we have to type in CRN numbers (class numbers) as fast as we can at a certain time and we have to do it FAST because it's first come first serve...Anyway, I had a Macro that did this for me, though this one kid made somthing that would type in all the numbers by the touch of a key, he used ICE hotkey or something like that. When we type are CRN numbers its 4-5 digits, tab over type another and etc... (just so you know what I mean). So does anyone know how to do this? I'm total noob so slow is good ). I think that this would help me out a whole lot in the future. Thanks again guys, and I hope to hear from you soon.


----------



## MattBro (Nov 11, 2006)

So, theoretically. You need something that will input your CRN number and TAB for some finite number of iterations?


----------



## tech-it-^ (Aug 18, 2006)

Exactly! That is a lot better explanation.


----------



## MattBro (Nov 11, 2006)

Is there a specific window that will retrieve this input?


----------



## tech-it-^ (Aug 18, 2006)

Well, all he did is he just pushed one key and all of his numbers entered in. It was into Internet explorer. it did ***** tab ***** tab ***** tab ***** etc... Is there anyway to do this? Thanks for your help.


----------



## MattBro (Nov 11, 2006)

There are quite a few ways of doing this. The most efficent, and the most low-level means would be to send window messages to the IE window. Therefor, emulating someone typing. This will be far more efficent than macros.

To do this, you would need to know a relatively low-level programming language such as C, pascal or even assembly.

If you would prefer me just to write it for you, that would be perfectly fine.


----------



## tech-it-^ (Aug 18, 2006)

Well normally I would say yes, but you see I'm a freshman and I am going into Computer Engineering and Computer Science. I would love to learn if possible. So if you maybe had some words of advice or some hints. It would help me out just starting. Thanks man, I appreciate it.


----------



## tech-it-^ (Aug 18, 2006)

*bump*


----------



## tech-it-^ (Aug 18, 2006)

bump*


----------



## shuuhen (Sep 4, 2004)

If you already know C, you might consider learning a little C#. It hides a lot of details like memory allocation from the programmer, which makes many tasks easier.

Python may be another viable candidate for the task. If you don't know the language already, it is supposed to be quick to learn (planning on learning it myself soon, but need to find more free time). A little googling showed that some people use it to control Internet Explorer.

Try looking through the documentation for the .NET framework (I think you can find it online at Microsoft's site, or you can browse it through SharpDevelop) for anything related to Internet Explorer and/or browsers (the ASP.NET probably won't be of any use though).

Either language should be sufficient for a relatively small program and fairly easy to use.


----------



## MattBro (Nov 11, 2006)

> Well normally I would say yes, but you see I'm a freshman and I am going into Computer Engineering and Computer Science. I would love to learn if possible. So if you maybe had some words of advice or some hints. It would help me out just starting. Thanks man, I appreciate it.


Well, the two function calls you'll need are;
SendMessage(...);
and
FindWindow(...);

Use FindWindow() to retrieve a handle to the IE window, which has the form you want to fill out.
And use SendMessage() to simulate keystrokes to that window.

For example:


```
HWND hIE = FindWindow(NULL, "Internet Explorer");

SendMessage(hIE, WM_KEYDOWN, 0x56, NULL);
```
Sorry for the late reply.


----------



## tech-it-^ (Aug 18, 2006)

thank you! No worries on the late response, though what are you using to do this? Thank you!


----------



## MattBro (Nov 11, 2006)

C/c++.


----------



## tech-it-^ (Aug 18, 2006)

sorry for my late response, I'm trying to learn the basics. Right now I'm trying to learn Python. Is there any other type of command you can issue me for this programming language? Thanks man.


----------



## MattBro (Nov 11, 2006)

Well, any language can access the function's I suggested. They are part of the Windows API, and therefor are part of the kernel itself.

Specifically, you'll need to link to: kernel32.dll, ntdll.dll and user32.dll

As these libraries contain the function's you are looking for.


----------



## MattBro (Nov 11, 2006)

Actually, after browsing Pythons documentation it may _not_ be possible. Python is not actually a programming language, it's an interpreted language.

I suggest you try C/C++. For an example:


```
#include <windows.h>

void main()
{
     hwndIE = FindWindow(NULL, "The IE Window's Name Which Contains The Form You Want To Fill Out");

     if(hwndIE)
     {
           // Input your CRN (Presuming it's "1234")
           SendMessage(hwndIE, WM_KEYDOWN, 0x31, 0x1L); // The '1' key.
           SendMessage(hwndIE, WM_KEYDOWN, 0x32, 0x1L); // The '2' key.
           SendMessage(hwndIE, WM_KEYDOWN, 0x33, 0x1L); // The '3' key.
           SendMessage(hwndIE, WM_KEYDOWN, 0x34, 0x1L); // The '4' key.
           SendMessage(hwndIE, WM_KEYDOWN, 0x09, 0x1L); // The TAB key.

           // Close the window handle.
           CloseHandle(hwndIE);
      }
}
```


----------



## tech-it-^ (Aug 18, 2006)

wow... ha this may be super basic for you, but for a guy just learning, this is definitely something I have to study up on more. So not possible with python? I heard t hat that was a really good language to learn at first if your just getting started with programming. What about you? I mean, you say C/C++, but is that for a person learning the basics. Thanks for everything man.


----------



## MattBro (Nov 11, 2006)

Well, once you know C++ every other language just falls into place. I started by learning Java, which was a bit of a mistake as half-way through learning I dropped it and learnt C++. Then returned to Java a year later and learnt it in a matter of hours.

I would suggest C, and not C++, as it's a procedural language which is a far more easier concept to grasp than those upheld in C++.

Every language pretty much is based on the same concepts as the others, the main difference is just syntax.


----------



## tech-it-^ (Aug 18, 2006)

alright, well thank you very much. That helps me out a lot. Thanks for everything.


----------

