Click here to get back home

Crossbow Phone Canvas extension does not support cascaded menu

 HomeNewsGroups | Search | About
 microsoft.public.smartphone.developer    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Crossbow Phone Canvas extension does not support cascaded menu Howard Cunningh 01-17-2007
Get Chitika Premium
Posted by Howard Cunningh on January 17, 2007, 7:51 am
Please log in for more thread options
I have been investigating how to extend the Phone Canvas for video telephony.
Using AKU sample code I have extended the SK2 menu on the phone dialogs with
no problem. My problem occurs when I try to extend the SK2 menu on CProg. In
this case, I need to add 5+ menu items to a menu that already has 8 items.
On a 220x176 Smart phone (all work is being done on DeviceEmulator using
FakeRil), there are 2 choices:
1. Add the 5+ items to the SK2 menu and use the default action of a single
level scrolling menu. This technique does not seem to be the 'way to go'.
2. Add the new items as a single pop up menu which would cascade. This is
the technique that is used in Contacts so I thought this would be the 'way to
go'. When you scroll to the new menu item and select it, rather than the
expected pop up menu displaying, the original SK2 Menu appears as shown in
the right image. My guess is that either:
a. I am doing something wrong in my code or there is a bug in Crossbow. The
key method in my code is the QueryContextMenu method as shown below (which I
adopted from sample code in the Crossbow AKU build 15342).
b. There is a bug in Crossbow with the extension of the Phone Canvas and it
is not retaining the handle to the pop up menu inserted.

virtual HRESULT STDMETHODCALLTYPE QueryContextMenu(
HMENU hmenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags
)
{
HRESULT hr = S_OK;
                
m_idc1 = idCmdFirst;
m_idc2 = idCmdFirst + 1;
m_idc3 = idCmdFirst + 2;
m_idc4 = idCmdFirst + 3;
m_idc5 = idCmdFirst + 4;

ASSERT(m_idc5 <= idCmdLast);

TCHAR szItemName[20];
                TCHAR szMenuName[] = TEXT("Video");
                
                hmenuPop = CreatePopupMenu();
                if (hmenuPop == NULL)
                {
                        hr = E_FAIL;
                        goto Error;
                }
                
hr = GetItemName(m_idc1, szItemName,
(sizeof(szItemName)/sizeof(szItemName[0])));
// Insert Menu 1
if (!InsertMenu(hmenuPop, 0xFFFFFFFF, MF_BYPOSITION | MF_STRING,
m_idc1, szItemName))
{
hr = E_FAIL;

goto Error;
}


hr = GetItemName(m_idc2, szItemName,
(sizeof(szItemName)/sizeof(szItemName[0])));
// Insert Menu 2
if (!InsertMenu(hmenuPop, 0xFFFFFFFF, MF_BYPOSITION | MF_STRING,
m_idc2, szItemName))
{
hr = E_FAIL;

goto Error;
}

hr = GetItemName(m_idc3, szItemName,
(sizeof(szItemName)/sizeof(szItemName[0])));
// Insert Menu 3
if (!InsertMenu(hmenuPop, 0xFFFFFFFF, MF_BYPOSITION | MF_STRING,
m_idc3, szItemName))
{
hr = E_FAIL;

goto Error;
}

hr = GetItemName(m_idc4, szItemName,
(sizeof(szItemName)/sizeof(szItemName[0])));
// Insert Menu 4
if (!InsertMenu(hmenuPop, 0xFFFFFFFF, MF_BYPOSITION | MF_STRING,
m_idc4, szItemName))
{
hr = E_FAIL;

goto Error;
}

hr = GetItemName(m_idc5, szItemName,
(sizeof(szItemName)/sizeof(szItemName[0])));
// Insert Menu 5
if (!InsertMenu(hmenuPop, 0xFFFFFFFF, MF_BYPOSITION | MF_STRING,
m_idc5, szItemName))
{
hr = E_FAIL;

goto Error;
}

if (!InsertMenu(hmenu, indexMenu, MF_BYPOSITION | MF_STRING |
MF_POPUP, (UINT)hmenuPop, szMenuName))
{
hr = E_FAIL;

goto Error;
}
                
// Indicate that one popup with five items have been inserted
hr = MAKE_HRESULT(SEVERITY_SUCCESS, 0, 1);

Error:
return hr;
}

Can anyone offer me any help or advice?
Thanks in advance for any help or advice you can give me.
Best regards,




--
Howard Cunnningham
RTP, NC

Posted by Riki on January 17, 2007, 2:23 pm
Please log in for more thread options
Howard Cunningham wrote:
> I have been investigating how to extend the Phone Canvas for video telephony.

Firstly Crossbow hasn't been announced. Secondly if you are working for
an OEM on a device, then you or your company will have signed an
agreement saying you won't talk about WM device development in public
forums. With the agreement you should have been provided with official
channels to seek help through.

Riki

Posted by Norman Diamond on January 18, 2007, 7:13 am
Please log in for more thread options

> Firstly Crossbow hasn't been announced.

http://download.microsoft.com/download/f/b/b/fbb3d5eb-53f5-4dbc-bbea-d06dd623cf6c/eula.rtf


Similar ThreadsPosted
Phone canvas customizaton... November 30, 2006, 2:28 am
Context menu extension June 7, 2005, 11:05 am
Outlook Contact Summary Context Menu Extension August 31, 2006, 11:50 am
wm_keydown and wm_keyup events for vk_ttalk button in windows mobile devices with phone support December 11, 2008, 5:09 am
How to Add menu to windows mobile 5 Smart phone July 5, 2006, 2:59 am
Crossbow on Qtek 8310 February 9, 2007, 8:49 am
L2CAP MTU configuration in Crossbow July 26, 2007, 4:44 am
How to get character set category of mail body on CrossBow April 3, 2007, 10:14 pm
Smartphone (Crossbow 15342) emulator image cannot attach from PB 5 January 3, 2007, 10:57 am
Calling an extension / Pin Code... June 28, 2005, 6:25 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap