View Single Post
Old 31st July 2012, 04:40   #20
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,970
Send a message via Skype™ to thinktink
I am currently working on getting my embed framework to automatically emulate what the the example gen window plugin is doing as far as showing and hiding the window from the inserted menu command and accelerator trapping. So far it's going ok. However there seems to be a small snafu:
code:
...
else if(message == WM_WINDOWPOSCHANGING)
{
/*
if extra_data[EMBED_STATE_EXTRA_REPARENTING] is set, we are being reparented by the freeform lib, so we should
just ignore this message because our visibility will not change once the freeform
takeover/restoration is complete
*/
WINDOWPOS *windowPos = (WINDOWPOS*)lParam;
embedWindowState *state=(embedWindowState *)GetWindowLongPtr(embedWnd,GWLP_USERDATA);
if (state && /*Looky here-->*/ state->reparenting /*<---Looky here*/ && !GetParent(embedWnd))
{
// this will reset the position of the frame when we need it to
// usually from going classic->modern->close->start->classic
SetWindowPos(embedWnd, 0, 0, 0, width, height,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE |
SWP_NOSENDCHANGING | SWP_ASYNCWINDOWPOS);
}
}
...



However, "reparenting" is not defined as a member of "embedWindowState" inside of wa_ipc.h:
code:
...
typedef struct
{
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 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
int extra_data[64]; // for internal winamp use
} embedWindowState;
...



Am I missing something? Do I have the wrong header?
thinktink is offline   Reply With Quote