I made a C++ Tapper, I fixed the errors seemingly, but it doesn't do anything. If anyone could tell me what's wrong, that would be awesome.
I don't fully understand the LRESULT CALLBACK, I tried using a void function but it gave me converting errors so I was told I had to use LRESULT CALLBACK.
Code:
// tapper2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <time.h>
using namespace std;
LRESULT CALLBACK ConnectInternet(int nCode, WPARAM wParam, LPARAM lParam)
{
system("NET START DHCP");
cout << "Connecting." << endl;
return 0;
}
LRESULT CALLBACK DCInternet(int nCode, WPARAM wParam, LPARAM lParam)
{
system("NET STOP DHCP");
cout << "Disconnecting." << endl;
return 0;
}
int main()
{
cout << "Welcome to Eddie's Tapper Program." << endl;
cout << "Press Page Down to disconnect your internet and Page Up to connect it." << endl;
for(;;)
{
SetWindowsHookEx(VK_PRIOR, ConnectInternet, GetModuleHandle(NULL), NULL);
SetWindowsHookEx(VK_NEXT, DCInternet, GetModuleHandle(NULL), NULL);
Sleep(200); // Keep from overloading the processor.
}
return 0;
}
That's everything, don't steal my code though.
Just to all the script kiddies / copy and pasters out there, if I see this recompiled and produced everywhere, I'm gonna bust some fucking heads.