Results 1 to 2 of 2

Thread: Basic HotKey C++ Hook Base

  1. #1
    Junior Member
    Join Date
    Mar 2015
    Posts
    4

    Basic HotKey C++ Hook Base

    I figured I'd start releasing my findings. My backgrounds are C++ based and D3D, so all this C# stuff is making me nuts :P


    Code:
    #include <windows.h>
    bool IsGameReadyForHook()
    {
        if( GetModuleHandle( "eldorado.exe"     ) != NULL  )
            return true;
    
    
        return false;
    }
    void main()
    {
     while (!IsGameReadyForHook()){
     Sleep(20);
     }
     bool test = false;
     bool panic = false;
     while(true){
     if(GetAsyncKeyState(VK_NUMPAD1)<0){
     if(test){
     
     test = false;
     } else {
     MessageBox(NULL, NULL, NULL, NULL);
     test = true;
     }
     }
     if(GetAsyncKeyState(VK_END)<0) {
     if(panic){
     panic = false;
     } else {
     exit(0);
     panic = true;
     }
     }
     Sleep(200);
     }
    }
    BOOL APIENTRY DllMain( HMODULE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
     )
    {
     switch (ul_reason_for_call)
     {
     case DLL_PROCESS_ATTACH:
     CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&main, NULL, 0,NULL);
     break;
     case DLL_THREAD_ATTACH:
     case DLL_THREAD_DETACH:
     case DLL_PROCESS_DETACH:
     break;
     }
     return TRUE;
    }

    I'll have some actual stuff out soon
    Reply With Quote

  2. #2

    Re: Basic HotKey C++ Hook Base

    christ I have no context. nvm
    Last edited by t3h m00kz; April 16th, 2015 at 02:18 AM.
    Reply With Quote

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •