Old 20th November 2013, 03:54   #1
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,009
Send a message via Skype™ to thinktink
"mlskinnedpopup"

So I'm trying to use the menu skinning API from ml and it's failing.

The menus I am creating can be run with the standard Windows API TrackPopupMenuEx(...) but for some reason SendMessageW is returning right away with a value of zero.

Code snippet of what's not working:
code:
if(mlwnd)
{
BOOL RES;
MLSKINNEDPOPUP mlsp;
memset(&mlsp,0,sizeof(mlsp));
mlsp.cbSize=sizeof(mlsp);
mlsp.hmenu=menu;
mlsp.fuFlags=uFlags;
mlsp.x=x;
mlsp.y=y;
mlsp.hwnd=owner;
mlsp.lptpm=lptpm;
mlsp.width=65536;
mlsp.skinStyle=SMS_USESKINFONT;
RES=::SendMessageW(mlwnd,WM_ML_IPC,(LPARAM)&mlsp,ML_IPC_TRACKSKINNEDPOPUPEX);
return RES;
}
else
{
return ::TrackPopupMenuEx(menu,uFlags,x,y,owner,lptpm);
}


What am I doing wrong?


[EDIT/]
And why did the forums wrongfully decide to lowercase my entire thread title?
thinktink is offline   Reply With Quote
Old 20th November 2013, 06:25   #2
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,009
Send a message via Skype™ to thinktink
Ah HA! I found out what was going on. Apparently, the version of MLSKINNEDPOPUP in my copy of ml_ipc_0313.h is 8 bytes short. The following is what I had to do to get it to work (hakzorz.)

code:
if(mlwnd)
{
BOOL RES;
struct lulz
{
MLSKINNEDPOPUP mlsp;
DWORD param1;
DWORD param2;
};
lulz mlsp;
//MLSKINNEDPOPUP mlsp;
memset(&mlsp,0,sizeof(mlsp));
#define mlspp mlsp.mlsp
mlspp.cbSize=sizeof(mlsp);
mlspp.hmenu=menu;
mlspp.fuFlags=uFlags;
mlspp.x=x;
mlspp.y=y;
mlspp.hwnd=owner;
mlspp.lptpm=lptpm;
#undef mlspp
RES=::SendMessageW(mlwnd,WM_ML_IPC,(LPARAM)&mlsp,ML_IPC_TRACKSKINNEDPOPUPEX);/**/
if(RES==0)
RES=::TrackPopupMenuEx(menu,uFlags,x,y,owner,lptpm);
return RES;
}
else
{
return ::TrackPopupMenuEx(menu,uFlags,x,y,owner,lptpm);
}

thinktink is offline   Reply With Quote
Old 20th November 2013, 09:05   #3
DrO
 
Join Date: Sep 2003
Posts: 27,873
typedef struct _MLSKINNEDPOPUP
{
INT cbSize;
HMENU hmenu;
UINT fuFlags;
int x;
int y;
HWND hwnd;
LPTPMPARAMS lptpm;
HMLIMGLST hmlil;
INT width;
UINT skinStyle;
MENUCUSTOMIZEPROC customProc;
ULONG_PTR customParam;
} MLSKINNEDPOPUP;
DrO is offline   Reply With Quote
Old 20th November 2013, 16:05   #4
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 3,009
Send a message via Skype™ to thinktink
Makes sense, thanks.
thinktink is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Tags
menu, popup, skin

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump