How add hotkey to Start And Stop

Posts 115 of 16 · Page 1 of 2
How add hotkey to Start And Stop
What is the code to add hotkey to a button

Like a hotkey to start and other to stop.

Can someone help me please?
#include <Windows.h>
bool You Features = 0;

bool IsReady();

void HackStart ()
{

while(IsReady()){

if ( GetAsyncKeyState(VK_NUMPAD1)&1)
Hack =! YourFeatures;

if ( bHack )
else

Sleep(100);
}
}

bool IsReady()
{
//Get the Module Handle of stuff you need to get the handle of.. You cant use the memory if the file hasnt loaded yet
}

BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);

if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE) HackStart, NULL, NULL, NULL);
}

return TRUE;
}
thanks but i need for Visual basic not C++ xD

thanks anyway.

Anyone know??
Quote Originally Posted by rubice24 View Post
thanks but i need for Visual basic not C++ xD

thanks anyway.

Anyone know??
Yeh, I've had some experience in vb:
source:
Code:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        KeyPreview = True
        'The KeyUp/KeyDown event will not work if any controls are on the form unless KeyPreview is True
    End Sub

  Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles D3D.Tick

If GetAsyncKeyState(Keys.Right) Then //blah your stuff here
End Sub


and put this right under forum 1 or w/e you called it

Code:
 Private Property result As Short
    Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Integer) As Short
Quote Originally Posted by tdct View Post


Yeh, I've had some experience in vb:
source:
Code:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        KeyPreview = True
        'The KeyUp/KeyDown event will not work if any controls are on the form unless KeyPreview is True
    End Sub

  Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles D3D.Tick

If GetAsyncKeyState(Keys.Right) Then //blah your stuff here
End Sub
But like how i add the hotkey where i put ,an example, F1??
Quote Originally Posted by rubice24 View Post
But like how i add the hotkey where i put ,an example, F1??
You don't know much about vb do you? I just showed you in the source. Make a timer, name it w/e then double click the timer and type
Code:
If GetAsyncKeyState(Keys.F1) Then //and put your code here
Quote Originally Posted by tdct View Post


You don't know much about vb do you? I just showed you in the source. Make a timer, name it w/e then double click the timer and type
Code:
If GetAsyncKeyState(Keys.F1) Then //and put your code here
It gives me this error

Error 1 'GetAsyncKeyState' is not declared. It may be inaccessible due to its protection level. C:\Users\.....\AppData\Local\Temporary Projects\............\Form1.vb 9 12
Quote Originally Posted by rubice24 View Post
It gives me this error

Error 1 'GetAsyncKeyState' is not declared. It may be inaccessible due to its protection level. C:\Users\.....\AppData\Local\Temporary Projects\............\Form1.vb 9 12
That is because you forgot to put
Code:
Private Property result As Short
    Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Integer) As Short
right under forum1 or whatever you named it(it should be the second or third line) in case you actually understand what this means. You need to declare that as global = needs to be on the top
And how the code goes to start or to Stop?

Like, how i add the hotkey F1 to Button1 and when i click F1 it will start

Understand?

Say me how i do it please
Ok
Sorry for forgot to say its for Visual Basic hehe
I'm not going to give you the code to the whole hack your trying to make T_T but
Code:
If GetAsyncKeyState(Keys.F1) Then if feature = 0 
//code for your hack here
feature = feature + 1 //feature++

Else
//code to turn of your hack
feature = feature - 1 //feature--
Quote Originally Posted by tdct View Post
I'm not going to give you the code to the whole hack your trying to make T_T but
Code:
If GetAsyncKeyState(Keys.F1) Then if feature = 0 
//code for your hack here
feature = feature + 1 //feature++

Else
//code to turn of your hack
feature = feature - 1 //feature--
Thanks for everything u are explaning but its not what i want

I want the next things:

I want the Button1 named Start, have a hotkey like if i dont wanna Alt + Tab to minimize i just click in F1 and it Start
Understand

And to Button2 named Stop, have a hotkey, like F2 to stop what i have started.

Please someone can help me?
Posts 115 of 16 · Page 1 of 2

Post a Reply

Tags for this Thread

None

Need help?