Advertisement
PwnFlakes

VLCmIRC.dll

Jan 15th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.33 KB | None | 0 0
  1. VLCmIRC.c
  2. ----------------------------------------------
  3. #include <windows.h>
  4. #include <stdio.h>
  5. HWND window;
  6. BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lp)
  7. {
  8.     const char *szPart = (const char*)lp;
  9.     char szText[256];
  10.     memset(&szText, 0, sizeof(szText));
  11.     GetWindowText(hWnd, szText, 256);
  12.     if (strstr(szText, szPart))
  13.     {
  14.         window = hWnd;
  15.         return FALSE;
  16.     }
  17.     return TRUE;
  18. }
  19. int __stdcall playing(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)
  20. {
  21.     EnumWindows((WNDENUMPROC)MyEnumProc, (LPARAM)"- VLC media player");
  22.     if (!IsWindow(window)) {
  23.         lstrcpy(data, "/echo -t [VLC] Not running/nothing in play queue.");
  24.         return 2;
  25.     }
  26.     char windowTitle[2048]; // pop this above this func if compiling on 2010
  27.     GetWindowText(window, windowTitle, sizeof(windowTitle));
  28.     windowTitle[strlen(windowTitle) - 19] = 0;
  29.     //lstrcpy(data, windowTitle);
  30.     //return 3;
  31.     sprintf_s(data, 300, "/me is now playing %s", windowTitle);
  32.     return 2;
  33. }
  34. ----------------------------------------------
  35.  
  36. VLCmIRC.def
  37. ----------------------------------------------
  38. LIBRARY
  39. EXPORTS
  40. playing
  41. ----------------------------------------------
  42.  
  43. MRC
  44. ----------------------------------------------
  45. alias F5 {
  46.   $dll(VLCmIRC.dll, playing,)
  47. }
  48. alias vlcnp {
  49.   $dll(VLCmIRC.dll, playing,)
  50. }
  51. ----------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement