Advertisement
Guest User

thishowiddoit.c

a guest
Jul 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "stdafx.h"
  2. #include "Windows.h"
  3. #include <iostream>
  4. #include <string>
  5. using namespace std;
  6.  
  7. int _cdecl _tmain(int argc, TCHAR *argv[])
  8. {
  9.     for (int i = 0xB0; i <= 0xB3; i++)
  10.         if (RegisterHotKey(NULL, 1, NULL, i))
  11.             printf("Hotkey 0x%02X registered\n", i);
  12.  
  13.     int count = 0;
  14.     MSG msg = { 0 };
  15.     while (GetMessage(&msg, NULL, 0, 0)) {
  16.         count++;
  17.  
  18.         char* name;
  19.         char *strings[] = {
  20.             "FORW",
  21.             "BACK",
  22.             "STOP",
  23.             "PLAY",
  24.         };
  25.  
  26.         if (msg.lParam < 0xB00000 || msg.lParam > 0xB30000)
  27.             abort();
  28.  
  29.         name = strings[msg.lParam - 0xB00000];
  30.         printf("==========================\n");
  31.         printf("Count:   %d\n", count);
  32.         printf("message: 0x%02X\n", msg.message);
  33.         printf("wParam:  0x%02X\n", msg.wParam);
  34.         printf("lParam:  0x%02X\n", msg.lParam);
  35.         printf("Media:   %s\n", name);
  36.     }
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement