1
0

browserHost.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. #ifndef NULLSOFT_WINAMP_OMBROWSER_BROWSERHOST_HEADER
  2. #define NULLSOFT_WINAMP_OMBROWSER_BROWSERHOST_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. class obj_ombrowser;
  8. typedef void (CALLBACK *DISPATCHAPC)(IDispatch *pDisp, ULONG_PTR /*param*/);
  9. HWND BrowserHost_CreateWindow(obj_ombrowser *browserManager, HWND hParent, UINT fStyle, INT x, INT y, INT cx, INT cy, INT controlId, HACCEL hAccel);
  10. #define NBHS_POPUP 0x00000001
  11. #define NBHS_SCRIPTMODE 0x00000002
  12. #define NBHS_DISABLECONTEXTMENU 0x00000004
  13. #define NBHS_DIALOGMODE 0x00000008
  14. #define NBHS_DISABLEHOSTCSS 0x00000010
  15. #define NBHS_BROWSERMASK 0x0000F000
  16. #define NBHS_BROWSERREADY 0x00001000
  17. #define NBHS_BROWSERACTIVE 0x00002000
  18. #define NBHM_FIRST (WM_USER + 200)
  19. #define NBHM_DESTROY (NBHM_FIRST + 10) // wParam = (WPARAM)(BOOL)fImmediate, lParam - not used. Preffered way to close it. Returns TRUE if processed
  20. // Post this messages
  21. #define NBHM_CONTAINERCOMMAND (NBHM_FIRST + 11) // wParam = (WPARAM)(INT)browserCommandId, lParam - not used
  22. #define NBHM_UPDATESKIN (NBHM_FIRST + 12) // wParam - not used, lParam - not used.
  23. #define NBHM_NAVIGATE (NBHM_FIRST + 13) // wParam - (WPARAM)(UINT)navigateFlags, lParam = (LPARAM)(BSTR)navigateUrl.
  24. #define NBHM_ENABLECONTAINERUPDATE (NBHM_FIRST + 14) // wParam - (WPARAM)(BOOL)fEnable, lParam = (WPARAM)(BOOL)fRedraw
  25. #define NBHM_QUEUEAPC (NBHM_FIRST + 15) // wParam = (WPARAM)userData, lParam = (LPARAM)(PAPCFUNC)pfnAPC
  26. #define NBHM_SHOWHISTORYPOPUP (NBHM_FIRST + 16) //wParam = (WPARAM)popupFlags, lParam =(LPARAM)MAKELPARAM(popupPos).
  27. #define NBHM_GETDISPATCHAPC (NBHM_FIRST + 17) // wParam = (WPARAM)param, lParam = (LPARAM)(DISPATCHAPC)callback
  28. #define NBHM_ACTIVATE (NBHM_FIRST + 18) // wParam - not used, lParam - not used. Activates browser (OLEIVERB_UIACTIVATE)
  29. #define NBHM_QUERYTITLE (NBHM_FIRST + 19) // wParam - not used, lParam - not used. Will query for current title and send NBHN_TITLECHANGE back
  30. #define NBHM_TOGGLEFULLSCREEN (NBHM_FIRST + 20) // wParam - not used, lParam - not used.
  31. #define NBHM_WRITEDOCUMENT (NBHM_FIRST + 21) // wParam - not used, lParam = (LPARAM)(BSTR)bstrDocument;
  32. #define NBHM_ENABLEWINDOW (NBHM_FIRST + 22) // wParam - not used, lParam = (LPARAM)(BOOL)fEnabled;
  33. #define NBHM_UPDATEEXTERNAL (NBHM_FIRST + 23) // wParam - not used, lParam - not used.
  34. #define NBHN_FIRST (200)
  35. #define NBHN_READY (NBHN_FIRST + 0)
  36. typedef struct __BHNNAVCOMPLETE
  37. {
  38. NMHDR hdr;
  39. IDispatch *pDispatch;
  40. VARIANT *URL;
  41. BOOL fTopFrame;
  42. } BHNNAVCOMPLETE;
  43. #define NBHN_DOCUMENTREADY (NBHN_FIRST + 1)
  44. #define NBHN_NAVIGATECOMPLETE (NBHN_FIRST + 2)
  45. typedef struct __BHNACTIVE
  46. {
  47. NMHDR hdr;
  48. BOOL fActive;
  49. } BHNACTIVE;
  50. #define NBHN_BROWSERACTIVE (NBHN_FIRST + 3)
  51. typedef struct __BHNCMDSTATE
  52. {
  53. NMHDR hdr;
  54. UINT commandId;
  55. BOOL fEnabled;
  56. } BHNCMDSTATE;
  57. #define NBHN_COMMANDSTATECHANGE (NBHN_FIRST + 4)
  58. typedef struct __BHNTEXTCHANGE
  59. {
  60. NMHDR hdr;
  61. LPCWSTR pszText;
  62. } BHNTEXTCHANGE;
  63. #define NBHN_STATUSCHANGE (NBHN_FIRST + 5)
  64. #define NBHN_TITLECHANGE (NBHN_FIRST + 6)
  65. typedef struct __BHNSECUREICON
  66. {
  67. NMHDR hdr;
  68. UINT iconId;
  69. } BHNSECUREICON;
  70. #define NBHN_SECUREICONCHANGE (NBHN_FIRST + 7)
  71. typedef struct __BHNSERVICE
  72. {
  73. NMHDR hdr;
  74. void *instance;
  75. } BHNSERVICE;
  76. #define NBHN_GETOMSERVICE (NBHN_FIRST + 8) // call service->AddRef() and return TRUE if you support this
  77. typedef struct __BHNCREATEPOPUP
  78. {
  79. NMHDR hdr;
  80. DISPATCHAPC callback;
  81. ULONG_PTR param;
  82. } BHNCREATEPOPUP;
  83. #define NBHN_CREATEPOPUP (NBHN_FIRST + 9)
  84. typedef struct __BHNVISIBLE
  85. {
  86. NMHDR hdr;
  87. BOOL fVisible;
  88. } BHNVISIBLE;
  89. #define NBHN_VISIBLECHANGE (NBHN_FIRST + 10) // send to popup
  90. typedef struct __BHNRESIZABLE
  91. {
  92. NMHDR hdr;
  93. BOOL fEnabled;
  94. } BHNRESIZABLE;
  95. #define NBHN_RESIZABLE (NBHN_FIRST + 11)
  96. typedef struct __BHNCLOSING
  97. {
  98. NMHDR hdr;
  99. BOOL isChild;
  100. BOOL cancel;
  101. } BHNCLOSING;
  102. #define NBHN_CLOSING (NBHN_FIRST + 12)
  103. typedef struct __BHNSHOWUI
  104. {
  105. NMHDR hdr;
  106. UINT elementId;
  107. BOOL fShow;
  108. } BHNSHOWUI;
  109. #define NBHN_SHOWUI (NBHN_FIRST + 13)
  110. typedef struct __BHNCLIENTTOHOST
  111. {
  112. NMHDR hdr;
  113. LONG cx;
  114. LONG cy;
  115. } BHNCLIENTTOHOST;
  116. #define NBHN_CLIENTTOHOST (NBHN_FIRST + 14)
  117. typedef struct __BHNSETWINDOWPOS
  118. {
  119. NMHDR hdr;
  120. UINT flags;
  121. LONG x;
  122. LONG y;
  123. LONG cx;
  124. LONG cy;
  125. } BHNSETWINDOWPOS;
  126. #define NBHN_SETWINDOWPOS (NBHN_FIRST + 15)
  127. typedef struct __BHNFOCUSCHANGE
  128. {
  129. NMHDR hdr;
  130. BOOL fAllow;
  131. } BHNFOCUSCHANGE;
  132. #define NBHN_FOCUSCHANGE (NBHN_FIRST + 16)
  133. typedef struct __BHNFULLSCREEN
  134. {
  135. NMHDR hdr;
  136. BOOL fEnable;
  137. } BHNFULLSCREEN;
  138. #define NBHN_FULLSCREEN (NBHN_FIRST + 17)
  139. #define NBHN_CLOSEPOPUP (NBHN_FIRST + 18) // param = NMHDR
  140. #endif // NULLSOFT_WINAMP_OMBROWSER_BROWSERHOST_HEADER