Computer Science Canada No Window |
Author: | chipanpriest [ Thu Jan 19, 2012 1:23 pm ] |
Post subject: | No Window |
What kind of command would I use if I wanted the program to run but no window to open? I want absolutely nothing to visually open on my computer when I run my program. Thanks in advance |
Author: | Beastinonyou [ Thu Jan 19, 2012 1:25 pm ] |
Post subject: | Re: No Window |
chipanpriest @ Thu Jan 19, 2012 1:23 pm wrote: if I wanted the program to run but no window to open?
What are you trying to run? What is the purpose for accomplishing that? |
Author: | Beastinonyou [ Thu Jan 19, 2012 1:29 pm ] | ||
Post subject: | Re: No Window | ||
The only thing I could think of would be the following:
|
Author: | Dreadnought [ Thu Jan 19, 2012 1:31 pm ] |
Post subject: | Re: No Window |
I don't think a window "opens" until you send output to it. So no output = no window. Alternatively, you can fool around with the Window module. |
Author: | mirhagk [ Thu Jan 19, 2012 3:52 pm ] |
Post subject: | RE:No Window |
actually you could shorten that code to just the View.Set line (which would make the window not pop up at all) |
Author: | Alex C. [ Thu Jan 19, 2012 4:13 pm ] |
Post subject: | RE:No Window |
what kind of program is it anyway? |
Author: | chipanpriest [ Fri Jan 20, 2012 12:19 pm ] | ||
Post subject: | Re: No Window | ||
Okay guys, I'll start over. I want to make a keylogger and a key logger obviously cannot have a window open but that's only one of my problems. I've gotten the program to work correctly when I use getch but in this case, I think Input.KeyDown would be a better command. My problem is, I don't know how to get turing to read which key is being pressed down as a string value. It takes the key you press down as a char and I don't know how to turn it into a string so any help there? I've tried a couple things like:
Anyone know how to turn ch into a string? |
Author: | Alex C. [ Fri Jan 20, 2012 12:37 pm ] |
Post subject: | RE:No Window |
um first off, char and string are able to mingle with one another so that is not your isse 2nd, i do believe that input.keydown is for boolean type variables (true or false), and has no conversion :/ |
Author: | Dreadnought [ Fri Jan 20, 2012 12:39 pm ] | ||||
Post subject: | Re: No Window | ||||
Actually, in your case ch is not a character value. ch is an array of boolean (true/false) variables. The indices of the array are all characters hence the declaration.
From this it should be obvious that you can't assign the value of an array of boolean values to a character variable. I think you've already come to the conclusion that a string is simply a sequence of characters (like an array of characters) and that a character variable and a string of length 1 (string(1)) are basically equivalent. So how can you convert this array of boolean characters into a string representing the keys being held down? Well, since the indices of the array are characters, if we could go through all characters and check if each one is pressed (true in the array) then we can simply add theses characters to a string and we're done. Example:
Note that for a key logger you will have to deal with keys being help down but not being typed multiple time. It may in fact be easier to use getchar and hasch to do what you want (this is entirely personal preference). |
Author: | Beastinonyou [ Fri Jan 20, 2012 1:05 pm ] | ||
Post subject: | Re: No Window | ||
indeed, you could detect input keys by using :
getch will store the character key that was pressed down, which only happens if hasch is true (has a character been pressed) I'm assuming if you're making a keylogger of some sort, you will be exporting the keys the user presses into a text document located somewhere? You would then transfer the keys pressed into the text file. You could also ensure that, say the user presses the Backspace button, you *could* erase the previous letter.. That is optional. |