PwnFlakes icon

VLCmIRC.dll

PwnFlakes | PRO | 01/16/15 02:43:44 AM UTC | 0 ⭐ | 272 👁️ | Never ⏰ | []
C |

1.33 KB

|

None

|

0 👍

/

0 👎

VLCmIRC.c
----------------------------------------------
#include <windows.h>
#include <stdio.h>
HWND window;
BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lp)
{
    const char *szPart = (const char*)lp;
    char szText[256];
    memset(&szText, 0, sizeof(szText));
    GetWindowText(hWnd, szText, 256);
    if (strstr(szText, szPart))
    {
        window = hWnd;
        return FALSE;
    }
    return TRUE;
}
int __stdcall playing(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)
{
    EnumWindows((WNDENUMPROC)MyEnumProc, (LPARAM)"- VLC media player");
    if (!IsWindow(window)) {
        lstrcpy(data, "/echo -t [VLC] Not running/nothing in play queue.");
        return 2;
    }
    char windowTitle[2048]; // pop this above this func if compiling on 2010
    GetWindowText(window, windowTitle, sizeof(windowTitle));
    windowTitle[strlen(windowTitle) - 19] = 0;
    //lstrcpy(data, windowTitle);
    //return 3;
    sprintf_s(data, 300, "/me is now playing %s", windowTitle);
    return 2;
}
----------------------------------------------
 
VLCmIRC.def
----------------------------------------------
LIBRARY
EXPORTS
playing
----------------------------------------------
 
MRC
----------------------------------------------
alias F5 {
  $dll(VLCmIRC.dll, playing,)
}
alias vlcnp {
  $dll(VLCmIRC.dll, playing,)
}
----------------------------------------------

Comments