| View previous topic :: View next topic |
| Author |
Message |
vegito616 Expert Cheater
Reputation: 0
Joined: 08 Jan 2006 Posts: 109
|
Posted: Wed May 02, 2007 6:40 pm Post subject: [HELP] Sending Keys to Process and how to get Pixels |
|
|
I was wondering how to send certain keys to specific processes through C++. I already know a way around the hooks any hack protection offers. I read about using HWND to get a process ID and use that somehow, but I need help with that.
Also on that note, i need help with getting a certain pixel in certain coordinates of that running process. How would that be accomplished?
If you any help please post,PM, AIM me(vegitodbz0),or add me on MSN([email protected])
Thanks
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Wed May 02, 2007 6:54 pm Post subject: |
|
|
| Send a WM_CHAR message with wParam as the virtual key-code of your key
|
|
| Back to top |
|
 |
the_undead Expert Cheater
Reputation: 1
Joined: 12 Nov 2006 Posts: 235 Location: Johannesburg, South Africa
|
Posted: Wed May 02, 2007 6:58 pm Post subject: |
|
|
| Code: | HWND Hwnd = FindWindow("CLASS", "NAME");
COLORREF Clr;
HDC Hdc = GetDC(Hwnd);
while(!(GetAsyncKeyState(VK_F8)))
{
Clr = GetPixel(Hdc, 100, 100 );
} |
or something like that
_________________
|
|
| Back to top |
|
 |
vegito616 Expert Cheater
Reputation: 0
Joined: 08 Jan 2006 Posts: 109
|
Posted: Thu May 03, 2007 12:15 pm Post subject: |
|
|
| but doesn\'t getPixel only get pixels from a bitmap image? Or does it also work with running processes?
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Thu May 03, 2007 12:29 pm Post subject: |
|
|
| it does not only get pixels from a bitmap image, works for windows too
|
|
| Back to top |
|
 |
vegito616 Expert Cheater
Reputation: 0
Joined: 08 Jan 2006 Posts: 109
|
Posted: Thu May 03, 2007 4:15 pm Post subject: |
|
|
| And could you just cout the Clr to get the value? Or do you have to do something special?
|
|
| Back to top |
|
 |
the_undead Expert Cheater
Reputation: 1
Joined: 12 Nov 2006 Posts: 235 Location: Johannesburg, South Africa
|
|
| Back to top |
|
 |
vegito616 Expert Cheater
Reputation: 0
Joined: 08 Jan 2006 Posts: 109
|
Posted: Fri May 04, 2007 8:05 am Post subject: |
|
|
| Does getPixel work for C programming also?
|
|
| Back to top |
|
 |
the_undead Expert Cheater
Reputation: 1
Joined: 12 Nov 2006 Posts: 235 Location: Johannesburg, South Africa
|
Posted: Fri May 04, 2007 10:26 am Post subject: |
|
|
yes
_________________
|
|
| Back to top |
|
 |
vegito616 Expert Cheater
Reputation: 0
Joined: 08 Jan 2006 Posts: 109
|
Posted: Fri May 04, 2007 11:00 am Post subject: |
|
|
How can you do FindWindow in C? When i try to use it in C it gives me the error:
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Fri May 04, 2007 12:25 pm Post subject: |
|
|
| undead's code is correct, you will have to show us the full (or at least surrounding) source code for us to see what you did wrong.
|
|
| Back to top |
|
 |
vegito616 Expert Cheater
Reputation: 0
Joined: 08 Jan 2006 Posts: 109
|
Posted: Fri May 04, 2007 12:42 pm Post subject: |
|
|
Lolz
Last edited by vegito616 on Wed Jul 04, 2007 10:32 pm; edited 1 time in total |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Fri May 04, 2007 12:56 pm Post subject: |
|
|
I see a lot of errors in your code you should fix.
sizeof ki should be sizeof(ki)
while (1) { if (Clr = 4294967295) <- should be while(Clr == 4294967295) //= assigns, == compares
and why aren't you initializing ki in the beginning of the code and instead choose to inside of the loop? stuff like dwFlags will never change..
|
|
| Back to top |
|
 |
vegito616 Expert Cheater
Reputation: 0
Joined: 08 Jan 2006 Posts: 109
|
Posted: Fri May 04, 2007 1:17 pm Post subject: |
|
|
I'm still getting this error:
2005\projects\rappelz\rappelz\rappelz.cpp(15) : error C2664: 'FindWindowW' : cannot convert parameter 2 from 'const char [8]' to 'LPCWSTR'
On this line:
HWND Hwnd = FindWindow(NULL, "Rappelz");
|
|
| Back to top |
|
 |
DeltaFlyer Grandmaster Cheater
Reputation: 0
Joined: 22 Jul 2006 Posts: 666
|
Posted: Fri May 04, 2007 1:27 pm Post subject: |
|
|
You could:
1. Use FindWindowA instead to used the ansi version of the api.
2. Add L in front of the string you're trying to use. Ex use L"This is a string" instead of "This is a string".
3. Use the TEXT macro, which just does the same thing as method #2.
_________________
Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for? |
|
| Back to top |
|
 |
|