|
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
|