View Single Post
Old 31st July 2012, 10:45   #22
DrO
 
Join Date: Sep 2003
Posts: 27,873
code:
#ifdef __cplusplus
class ifc_window;
#endif

typedef struct embedWindowState embedWindowState;

#define FFC_CREATEEMBED 0 // param = (LPARAM)(ifc_window*)windowParent; return 1 to terminate creation.
#define FFC_DESTROYEMBED 1

typedef int (CALLBACK *FFCALLBACK)(embedWindowState* /*windowState*/, INT /*eventId*/, LPARAM /*param*/);

typedef struct embedWindowState
{
HWND me; //hwnd of the window

#define EMBED_FLAGS_NORESIZE 0x1
// set this bit to keep window from being resizable

#define EMBED_FLAGS_NOTRANSPARENCY 0x2
// set this bit to make gen_ff turn transparency off for this window

#define EMBED_FLAGS_NOWINDOWMENU 0x4
// set this bit to prevent gen_ff from automatically adding your window to the right-click menu

#define EMBED_FLAGS_GUID 0x8
// (5.31+) call SET_EMBED_GUID(yourEmbedWindowStateStruct, GUID) to define a GUID for this window

#define EMBED_FLAGS_FFCALLBACK 0x10
// 5.55+

#define SET_EMBED_GUID(windowState, windowGUID) { windowState->flags |= EMBED_FLAGS_GUID; *((GUID *)&windowState->extra_data[4])=windowGUID; }
#define GET_EMBED_GUID(windowState) (*((GUID *)&windowState->extra_data[4]))

int flags; // see above

RECT r;
void *user_ptr; // for application use

union
{
#pragma warning(push)
#pragma warning(disable:4201)
#pragma pack(push, 1)
struct
{
struct embedWindowState *link;
intptr_t attached;
intptr_t padding1[2]; //2-3
GUID guid; // 4-7
#ifdef _WIN64
intptr_t guidpadding;
#endif
FFCALLBACK callback;
intptr_t padding2[52]; // 9-60
intptr_t hostcount; // 61
intptr_t reparenting; // 62
#ifdef __cplusplus
ifc_window *wasabi_window;
#else
void *wasabi_window; // ifc_window *
#endif
};
#pragma warning(pop)
#pragma pack(pop)
intptr_t extra_data[64]; // for internal winamp use
};
} embedWindowState;

there's stuff in there i've no idea about (mainly the FF* stuff). though clearly no one has bothered to use the example as that should have been caught (so yay, i wasted a few more hours of my life doing that *grumble* ).

-daz
DrO is offline   Reply With Quote