| View previous topic :: View next topic |
| Author |
Message |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sat Nov 08, 2008 8:36 am Post subject: [SOLVED] Intercepting mouseclicks/keystrokes |
|
|
Hi,
I've successfully made a direct3d hook to display stuff over a gg-protected game. That's all working perfectly.
Now I want to display buttons and make them clickable. So what would be the best way to do that? I've heard of subclassing a window, and installing a windows-hook but I think gameguard will prevent me from doing that.
For intercepting keypresses, I could use GetAsyncKeyState/RegisterHotkey on every key but I don't think that's a good solution.
Suggestions would be appreciated.
Thanks in advance,
Tombana
Last edited by tombana on Sat Nov 08, 2008 9:28 am; edited 1 time in total |
|
| 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 Nov 08, 2008 8:47 am Post subject: Re: Intercepting mouseclicks/keystrokes |
|
|
Well, definitely not RegisterHotkey, as each key can only be used as 1 hotkey, destroying many other applications etc.
I'm not really sure about this sort of thing, but I just wanted to say that.
_________________
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 |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sat Nov 08, 2008 9:27 am Post subject: |
|
|
Nevermind, I solved it. I tried subclassing the window and it worked. I thought gameguard would prevent me to but they didn't.
Feel free to remove this thread.
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Nov 08, 2008 9:46 am Post subject: |
|
|
| Well, If you also want to send keystrokes you can use the same method you use for hooking d3d on dinput. Then hooking the function that checks the key states and call it yourself in the hooked version then you can send your own keystrokes by adding it to the return array.
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sat Nov 08, 2008 11:50 am Post subject: |
|
|
| Well for sending keys I can just use a simple PostMessage (bypassed) or a CallWindowProc. I believe that for sending arrow keys I need to use dinput but I don't need arrow keys. (And with subclassing I cán intercept arrow keys) But thanks for the information anyway.
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Nov 08, 2008 12:06 pm Post subject: |
|
|
| and thanks to you for helping me with the dx overlay thing. But now... I hooked everything but I don't know ho to draw graphics. fail eh?
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sat Nov 08, 2008 12:31 pm Post subject: |
|
|
If you've successfully hooked everything, just try drawing some text:
| Code: |
LPD3DXFONT m_font; //Pointer to the font interface
//Create the font interface:
//pD3DDevice is the thing you got from CreateDevice
D3DXCreateFont(pD3DDevice, 20, 0, FW_DONTCARE, 0, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &m_font);
//At your EndScene hook add this:
RECT rct;
rct.top = 10; rct.bottom = 30; rct.left = 10; rct.right = 100;
m_font->DrawText(NULL, "Hi there!", -1, &rct, 0, D3DCOLOR_ARGB(255, 255, 0, 0));
//then call the original EndScene
|
|
|
| Back to top |
|
 |
|