Click here to get back home

Dynamically replace menu toolbar

 HomeNewsGroups | Search | About
 microsoft.public.smartphone    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
Dynamically replace menu toolbar Johannes 08-06-2007
Posted by r_z_aret on August 8, 2007, 4:43 pm
Please log in for more thread options
On Wed, 8 Aug 2007 00:19:14 -0700, Johannes

>
>
>"r_z_aret@pen_fact.com" wrote:
>
>> On Mon, 6 Aug 2007 23:46:00 -0700, Johannes
>>
>> >See below.
>> >
>> >"r_z_aret@pen_fact.com" wrote:
>> >
>> >> On Mon, 6 Aug 2007 02:24:04 -0700, Johannes
>> >>
>> >> >I would like to replace the toolbar with another toolbar from my
resources
>> >> >using the Windows.
>> >> >
>> >> >My attempt so far involves:
>> >> >
>> >> >1. Calling SHCreateMenuBar when the application is initialized to load a
>> >> >toolbar from my resources.
>> >>
>> >> This is the right function to use when creating a menu for a Windows
>> >> Mobile application
>> >>
>> >>
>> >> >
>> >> >2. Calling CommandBar_Destroy + SHCreateMenuBar to change it to another
>> >> >toolbar. This does not work; the Windows start menu toolbar is displayed
>> >> >instead even though SHCreateMenuBar does not indicate an error.
>> >>
>> >> I don't see any reason to call CommandBar_Destroy. What is "it" in the
>> >> phrase "change it to another toolbar"? How are you checking
>> >> SHCreateMenuBar for errors?
>> >
>> >I check both the return of SHCreateMenuBar and IsWindow(hwndMB).
>>
>> Try calling GetLastError message when SHCreateMenuBar fails, and then
>> use Tools->Error Lookup to interpret the error code from GetLastError.
>> If you don't understand the explanation (likely, because they _are_
>> cryptic), report it here and someone will likely provide a more
>> understandable interpretation.
>
>You seem to have misunderstood me. It does not give any error message,
>SHCreateMenuBar and IsWindow returns true. The menu bar is however not
>displayed.
>
>> >
>> >> Are you trying to change the toolbar/menu for you app, or for the
>> >> whole device?
>> >
>> >I want to change the menu toolbar for my application.
>>
>> Do you really want to change the toolbar while your application is
>> running? Or just modify it? I'm not at all sure you can change it. I
>> know you can modify (add, remove, change captions) an existing
>> toolbar.
>>
>> I think if you step back a bit and explain why you think you need to
>> change the toolbar, one of us will have a better idea how to help. For
>> example, tell us what you want the user to see.
>
>I want to display different options (through menus I have in the resources)
>to the user depending on application state. In some states I don't want to
>display an option menu at all, just an exit menu bar item.

I do that by adding and removing items from the existing Tool Bar. I
use CommandBar_AddBitmap; it works for all Windows CE platforms I've
tried, including several variations of Windows Mobile.

I _think_ if you define the variable submenus (the ones you want to
add and remove) separately, you can use submenus defined in resource
files. Something like
POPUP ACTIONS_STRING
BEGIN
MENUITEM TOGGLE_SIP_STRING, IDM_SHOWSIP
END
But I've never tried such a thing.

>
>>
>> >
>> >>
>> >> >
>> >> >What am I doing wrong?
>> >> >
>> >> >Regards,
>> >> >
>> >> >Johannes
>> >>
>> >> -----------------------------------------
>> >> To reply to me, remove the underscores (_) from my email address (and
please indicate which newsgroup and message).
>> >>
>> >> Robert E. Zaret, eMVP
>> >> PenFact, Inc.
>> >> 20 Park Plaza, Suite 478
>> >> Boston, MA 02116
>> >> www.penfact.com
>> >>
>>
>> -----------------------------------------
>> To reply to me, remove the underscores (_) from my email address (and please
indicate which newsgroup and message).
>>
>> Robert E. Zaret, eMVP
>> PenFact, Inc.
>> 20 Park Plaza, Suite 478
>> Boston, MA 02116
>> www.penfact.com
>>

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please
indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com

Similar ThreadsPosted
Toolbar for Windows Mobile IE January 18, 2006, 6:49 am
Is it possible to replace Outlook for Syncing? January 21, 2008, 8:25 am
Clamshell to replace Audiovox 5600 Functionality? June 2, 2006, 6:24 pm
Is it possiable to complete replace smartdial feture? October 19, 2006, 4:21 am
How to replace customize volume adjust program April 9, 2008, 1:44 am
Replace mobile number to a Text with GSM modem and AT commands July 30, 2005, 12:15 am
contact manager & agenda to replace Outlook & which syncs with WM 6 June 18, 2007, 9:26 am
Menu.OnPaint April 7, 2006, 9:08 am
Start menu order August 16, 2005, 12:16 pm
Text Start Menu? October 17, 2006, 5:55 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap