Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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,)
- }
- ----------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement