Wacommands.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef ___WINAMP_COMMANDS___H___
  2. #define ___WINAMP_COMMANDS___H___
  3. #include "../winamp/wa_ipc.h"
  4. #include "wa_hotkeys.h"
  5. // calls SetForegroundWindow before sending the message
  6. #define HKF_BRING_TO_FRONT 0x1
  7. // sets wParam with Winamp's window handle
  8. #define HKF_WPARAM_HWND 0x2
  9. // copies returned text to the clipboard (CF_TEXT)
  10. #define HKF_COPY_RET 0x4
  11. // sets wParam with current pledit position
  12. #define HKF_WPARAM_PLPOS 0x8
  13. // sets wParam to genHotkeysAddStruct's wParam if playing, lParam if not
  14. // uses IPC_ISPLAYING to check if playing
  15. #define HKF_WPARAM_ISPLAYING_WL 0x10
  16. // brings Winamp to front or minimizes Winamp if already at front
  17. #define HKF_SHOWHIDE 0x20
  18. #define HKF_CUSTOM_FUNC 0x40
  19. // copies returned text to the clipboard (CF_UNICODETEXT)
  20. #define HKF_COPYW_RET 0x80
  21. #define HKF_UNICODE_NAME 0x100
  22. // set this when the 'name' is passed as a unicode string
  23. typedef void (*pfnWAC)();
  24. struct WACommand
  25. {
  26. wchar_t *id;
  27. char *name;
  28. DWORD dwFlags;
  29. UINT uMsg;
  30. WPARAM wParam;
  31. LPARAM lParam;
  32. BOOL bEnabled;
  33. HWND wnd;
  34. };
  35. extern WACommand *WACommands;
  36. extern inline unsigned int GetCommandsNum();
  37. void InitCommands();
  38. int AddCommand(genHotkeysAddStruct *ghas);
  39. extern inline char *GetCommandName(unsigned int i, bool *unicode);
  40. extern inline wchar_t *GetCommandId(unsigned int i);
  41. int GetCommandIdx(wchar_t *id);
  42. int DoCommand(unsigned int i);
  43. #endif