View previous topic :: View next topic |
Author |
Message |
--Pillboi-- Grandmaster Cheater Supreme
Reputation: 0
Joined: 06 Mar 2007 Posts: 1383 Location: I don't understand the question. Is this a 1 to 10 thing?
|
Posted: Fri Apr 18, 2008 12:27 pm Post subject: [RLS / HelpMe] KeepCapsLockOn Prank. |
|
|
This is a pretty lame prank, created solely by me. What it does is keeps Caps Lock on/Makes you write in upper-case, regardless if shift is pressed or not.
The problems I am having with it are stated within the source code.
Thanks for any help you may give me.
Sorry I couldn't release this as a fully functioning program.
Edit: Doesn't really make a big difference, but just realised, it should have a "return 0;" at the end.
Edit 2: Almost all problems fixed, except for holding caps lock down, turns it off, and the program randomly closes/crashes other windows/doesn't let them open.
_________________
Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Last edited by --Pillboi-- on Sat Apr 19, 2008 4:27 am; edited 2 times in total |
|
Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Fri Apr 18, 2008 1:30 pm Post subject: |
|
|
GetKeyState return 1,0,-127,-128:
0: If key NOT pressed and NOT toggle.
1: If key NOT pressed and toggle.
-127: If key pressed and toggle.
-128: If key pressed and NOT toggle.
|
|
Back to top |
|
 |
--Pillboi-- Grandmaster Cheater Supreme
Reputation: 0
Joined: 06 Mar 2007 Posts: 1383 Location: I don't understand the question. Is this a 1 to 10 thing?
|
Posted: Fri Apr 18, 2008 1:56 pm Post subject: |
|
|
Thanks, I tried to learn from your example. Thank you very much!
Sorry, no offence, but did that .exe have malicious code on it, because after running it, my computer is screwing up.
_________________
Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair. |
|
Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Fri Apr 18, 2008 2:34 pm Post subject: |
|
|
It's not malicious but it DOES take up ALL of the processing time. Greedy program needs some sleep time (Sleep(10) .
|
|
Back to top |
|
 |
--Pillboi-- Grandmaster Cheater Supreme
Reputation: 0
Joined: 06 Mar 2007 Posts: 1383 Location: I don't understand the question. Is this a 1 to 10 thing?
|
Posted: Sat Apr 19, 2008 3:36 am Post subject: |
|
|
Hmmm yeah. I better do some repair work to my computer. It's dying on me! It's even restarting half way through start up...
Adding Sleep(10) now.
Edit: It's taking 2+ minutes to open a folder, 30+ seconds to open the start menu, and SYSTEM is using up 95% of my cpu.
_________________
Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair. |
|
Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Sat Apr 19, 2008 4:02 am Post subject: |
|
|
--Pillboi-- wrote: | Hmmm yeah. I better do some repair work to my computer. It's dying on me! It's even restarting half way through start up...
Adding Sleep(10) now.
Edit: It's taking 2+ minutes to open a folder, 30+ seconds to open the start menu, and SYSTEM is using up 95% of my cpu.  | My computer working normal o.O
|
|
Back to top |
|
 |
--Pillboi-- Grandmaster Cheater Supreme
Reputation: 0
Joined: 06 Mar 2007 Posts: 1383 Location: I don't understand the question. Is this a 1 to 10 thing?
|
Posted: Sat Apr 19, 2008 7:37 am Post subject: |
|
|
It's probably not your program. Dw.
Anti-virus programs aren't picking up anything though.
Phew, cpu has gone back to normal.
Back on topic - If you hold caps lock down, it seems to be turning off caps lock... (By "seems", I mean, the LED goes off. Not sure if it is actually turning it off) Re uploading my source and program now.
Quick unrelated question: How do you make the value of a #define, into the value of a variable? By that, I mean, something like: #define DEFINITION userinput
_________________
Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair. |
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat Apr 19, 2008 7:45 am Post subject: |
|
|
--Pillboi-- wrote: | Quick unrelated question: How do you make the value of a #define, into the value of a variable? By that, I mean, something like: #define DEFINITION userinput |
Define it as a way to get userinput like say to get the int value from a string:
#define DEFINTION GetDlgItemInt(....);
_________________
|
|
Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sat Apr 19, 2008 7:58 am Post subject: |
|
|
lurc wrote: | --Pillboi-- wrote: | Quick unrelated question: How do you make the value of a #define, into the value of a variable? By that, I mean, something like: #define DEFINITION userinput |
Define it as a way to get userinput like say to get the int value from a string:
#define DEFINTION GetDlgItemInt(....); |
Code: | #define SOMETHING 672
int SomethingElse = SOMETHING; |
Like this?
|
|
Back to top |
|
 |
--Pillboi-- Grandmaster Cheater Supreme
Reputation: 0
Joined: 06 Mar 2007 Posts: 1383 Location: I don't understand the question. Is this a 1 to 10 thing?
|
Posted: Sat Apr 19, 2008 10:26 am Post subject: |
|
|
lurc wrote: | Define it as a way to get userinput like say to get the int value from a string: |
Unfortunately, I already thought of that. The reason I can't do it, is that multiple values are taken in at the same time: scanf("%d %d", &la, &lala);
And enter should only be pressed once, at the end.
Noz3001: Code: | int SomethingElse = SOMETHING; |
Makes SomethingElse equal to 672. But SOMETHING is still 672.
What I need is, a way to give SOMETHING, SomethingElse's value.
_________________
Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair. |
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat Apr 19, 2008 10:33 am Post subject: |
|
|
int SomethingElse = 1;
#define SOMETHING SomethingElse
_________________
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8586 Location: 127.0.0.1
|
Posted: Sat Apr 19, 2008 10:54 am Post subject: |
|
|
Code: | #define FIRST_PARAM 0xFF
#define SECOND_PARAM 0x2
#include <stdio.h>
#include <tchar.h>
int main()
{
int iFirst = FIRST_PARAM;
_tprintf( _T("%d %d"), iFirst, SECOND_PARAM );
return 0;
} |
Works fine with defines.
_________________
- Retired. |
|
Back to top |
|
 |
HalfPrime Grandmaster Cheater
Reputation: 0
Joined: 12 Mar 2008 Posts: 532 Location: Right there...On your monitor
|
Posted: Sat Apr 19, 2008 11:13 am Post subject: |
|
|
Is it even possible to change the value of a #define? And, I don't think you can call functions before main?
|
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat Apr 19, 2008 11:40 am Post subject: |
|
|
No i dont think so, unless the mask it defines is a changing value like the GetDlgItemInt i said above.
And yes you can call functions cause its not calling a function because its not getting called until you call the definition, (which will be somewhere in a function or in main)
i like to think of definitions as just something to replace code... without the restrictions of types, parameters, etc.
_________________
|
|
Back to top |
|
 |
HalfPrime Grandmaster Cheater
Reputation: 0
Joined: 12 Mar 2008 Posts: 532 Location: Right there...On your monitor
|
Posted: Sat Apr 19, 2008 12:06 pm Post subject: |
|
|
Ah, thanks, I was getting messed up.
hmmm, if it really has to be a #define, you could do
[psuedo]
Code: | #define DEF(str1, str2) ("%s, %d", &str1, &str2)
input(astring)
input(astring2)
somefunc(DEF(astring, astring2)); |
Or some crazy thing like that, maybe.
Why's it have to be a #define, anyways?
|
|
Back to top |
|
 |
|