void config(struct winampVisModule *this_mod)
{
MessageBox(this_mod->hwndParent,"This module is Copyright (c) 1997-1998, Justin Frankel/Nullsoft\n"
"-- This is just a demonstration module, it really isn't\n"
" supposed to be enjoyable --","Configuration",MB_OK);
}
embedWindowState myWindowState; // <--<<< //
winampVisModule *g_mod = NULL;
int width;
int height;
// initialization. Registers our window class, creates our window, etc. Again, this one works for
// both modules, but you could make init1() and init2()...
// returns 0 on success, 1 on failure.
int init(struct winampVisModule *this_mod)
{
int styles;
HWND parent = NULL;
HWND (*e)(embedWindowState *v); // <--<<< //
width = (this_mod == &mod3)?256:288; // width and height are the same for mod1 and mod2,
height = (this_mod == &mod3)?32:256; // but mod3 is shaped differently
// >>>--> //
g_mod = this_mod;
config_read(this_mod);
// uncomment this line if your plugin draws to the screen using
directx OVERLAY mode
// myWindowState.flags |= EMBED_FLAGS_NOTRANSPARENCY;
myWindowState.r.left = config_x; // <--<<< //
myWindowState.r.top = config_y;
myWindowState.r.right = config_x + width;
myWindowState.r.bottom = config_y + height;
// <--<<< //
*(void**)&e = (void *)SendMessage(this_mod->hwndParent,WM_WA_IPC,(LPARAM)0,IPC_GET_EMBEDIF);
// >>>--> //
if (!e)
{
MessageBox(this_mod->hwndParent,"This plugin requires Winamp 5.0+","blah",MB_OK);
return 1;
}
parent = e(&myWindowState); // <--<<< //
SetWindowText(myWindowState.me, this_mod->description); // set our window title
{ // Register our window class
WNDCLASS wc;
memset(&wc,0,sizeof(wc));
wc.lpfnWndProc = WndProc; // our window procedure
wc.hInstance = this_mod->hDllInstance; // hInstance of
DLL
wc.lpszClassName = szAppName; // our window class name
if (!RegisterClass(&wc))
{
MessageBox(this_mod->hwndParent,"Error registering window class","blah",MB_OK);
return 1;
}
}
styles = WS_VISIBLE|WS_CHILDWINDOW|WS_OVERLAPPED|WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
hMainWnd = CreateWindowEx(
0, // these exstyles put a nice small frame,
// but also a button in the taskbar
szAppName, // our window class name
NULL, // no title, we're a child
styles, // do not make the window visible
config_x,config_y, // screen position (read from config)
width,height, // width & height of window (need to adjust client area later)
parent, // parent window (winamp main window)
NULL, // no menu
this_mod->hDllInstance, // hInstance of
DLL
0); // no window creation data