Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // gcc myplugin.c -shared -o ml_myplugingcc.dll
- // copy ml_myplugingcc.dll to 'C:\Program Files (x86)\Winamp\Plugins'
- //
- #include <windows.h>
- #define MLHDR_VER 0x15
- typedef struct {
- int version;
- char *description;
- int (*init)();
- void (*quit)();
- INT_PTR (*MessageProc)(int message_type, INT_PTR param1, INT_PTR param2, INT_PTR param3);
- HWND hwndWinampParent;
- HWND hwndLibraryParent;
- HINSTANCE hDllInstance;
- } winampMediaLibraryPlugin;
- int Init()
- {
- return 0;
- }
- void Quit()
- {
- MessageBoxA(NULL, "Quit() from C", "Message", 0);
- }
- INT_PTR MessageProc(int message_type, INT_PTR param1, INT_PTR param2, INT_PTR param3)
- {
- return 0;
- }
- winampMediaLibraryPlugin plugin =
- {
- MLHDR_VER,
- "My Cool Plugin C",
- Init,
- Quit,
- MessageProc,
- 0,
- 0,
- 0,
- };
- __declspec(dllexport) winampMediaLibraryPlugin *winampGetMediaLibraryPlugin()
- {
- return &plugin;
- }
- BOOL __stdcall DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved)
- {
- switch (ulReason)
- {
- case DLL_PROCESS_ATTACH:
- break;
- case DLL_PROCESS_DETACH:
- break;
- case DLL_THREAD_ATTACH:
- break;
- case DLL_THREAD_DETACH:
- break;
- default:
- break;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement