Hey Guys,
I am Currently making a Menu DLL, but can't seem to get it to work. well it kinda works but the menus are grayed out and don't drop down.
It works Perfectly when I use Darkbasic but when I use the DLL it don't. View the Image to see what is happening
Can anyone See what I'm doing wrong?
DBPro
Function Init_Menus()
Load DLL "user32.dll", 1
EndFunction
function MakeMenuBar(Parent)
Handle as DWORD
Handle = Call DLL( 1, "CreateMenu" )
Call DLL 1, "SetMenu",Parent,Handle
Endfunction Handle
function MakeMenu(Parent,Text$)
Handle as DWORD
Handle = Call DLL( 1, "CreateMenu" )
Call DLL 1, "AppendMenuA",Parent, 0x00000000 || 0x00000010, handle, Text$
Endfunction Handle
Function MakeMenuItem(Parent,Text$,CommandID)
Call DLL 1, "AppendMenuA",Parent, 0x00000000, CommandID, Text$
Endfunction
DLL c++ code
MYCOMMAND HMENU CreateMenuBar( HWND Parent )
{
HMENU Handle=CreateMenu();
SetMenu(Parent,Handle);
return Handle;
}
MYCOMMAND HMENU CreateMenu(HMENU Parent,LPCSTR Text)
{
HMENU Handle=CreateMenu();
AppendMenuA( Parent, MF_STRING || MF_POPUP, (UINT_PTR)Handle, Text);
return Handle;
}
MYCOMMAND void CreateMenuItem(HMENU Parent,int CommandID,LPCSTR Text)
{
AppendMenuA(Parent,MF_STRING,(UINT_PTR)CommandID,Text);
}