api_winamp.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef NULLSOFT_WINAMP_API_WINAMP_HEADER
  2. #define NULLSOFT_WINAMP_API_WINAMP_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <bfc/dispatch.h>
  7. // {5968E566-805E-442f-B6A0-916F9CD4E8A8}
  8. static const GUID winampApiGuid =
  9. { 0x5968e566, 0x805e, 0x442f, { 0xb6, 0xa0, 0x91, 0x6f, 0x9c, 0xd4, 0xe8, 0xa8 } };
  10. class __declspec(novtable) api_winamp : public Dispatchable
  11. {
  12. protected:
  13. api_winamp() {}
  14. ~api_winamp() {}
  15. public:
  16. HWND GetMainWindow(void);
  17. HWND GetDlgParent(void);
  18. HRESULT OpenUrl(HWND hwnd, const wchar_t *url);
  19. int GetRegVer();
  20. public:
  21. DISPATCH_CODES
  22. {
  23. API_GETMAINWINDOW = 10,
  24. API_GETDLGPARENT = 20,
  25. API_OPENURL = 30,
  26. API_GETREGVER = 40,
  27. };
  28. };
  29. inline HWND api_winamp::GetMainWindow(void)
  30. {
  31. return _call(API_GETMAINWINDOW, (HWND)NULL);
  32. }
  33. inline HWND api_winamp::GetDlgParent(void)
  34. {
  35. return _call(API_GETDLGPARENT, (HWND)NULL);
  36. }
  37. inline HRESULT api_winamp::OpenUrl(HWND hwnd, const wchar_t *url)
  38. {
  39. return _call(API_OPENURL, (HRESULT)E_NOTIMPL, hwnd, url);
  40. }
  41. inline int api_winamp::GetRegVer()
  42. {
  43. return _call(API_GETREGVER, (int)0);
  44. }
  45. #endif // NULLSOFT_WINAMP_API_WINAMP_HEADER