Go Back   Technology Questions > Hardware Questions > Electronics > Smartphones

Smartphones This is the Microsoft General Public Smartphones Newsgroup.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 08-06-2007, 01:30 AM
Johannes
Tablet PC Guest
 
Posts: n/a
Dynamically replace menu toolbar

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.

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.

What am I doing wrong?

Regards,

Johannes
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 08-06-2007, 01:30 AM
Xploder HD Movie Player for PS3. Manage, convert and transfer media files between the PC and PS3.
  #2 (permalink)  
Old 08-06-2007, 11:20 AM
r_z_aret@pen_fact.com
Tablet PC Guest
 
Posts: n/a
Re: Dynamically replace menu toolbar

On Mon, 6 Aug 2007 02:24:04 -0700, Johannes
<Johannes@discussions.microsoft.com> wrote:

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

Are you trying to change the toolbar/menu for you app, or for the
whole device?


>
>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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 08-06-2007, 10:50 PM
Johannes
Tablet PC Guest
 
Posts: n/a
Re: Dynamically replace menu toolbar

See below.

"r_z_aret@pen_fact.com" wrote:

> On Mon, 6 Aug 2007 02:24:04 -0700, Johannes
> <Johannes@discussions.microsoft.com> wrote:
>
> >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).

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

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 08-07-2007, 07:40 AM
r_z_aret@pen_fact.com
Tablet PC Guest
 
Posts: n/a
Re: Dynamically replace menu toolbar

On Mon, 6 Aug 2007 23:46:00 -0700, Johannes
<Johannes@discussions.microsoft.com> wrote:

>See below.
>
>"r_z_aret@pen_fact.com" wrote:
>
>> On Mon, 6 Aug 2007 02:24:04 -0700, Johannes
>> <Johannes@discussions.microsoft.com> wrote:
>>
>> >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.

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


>
>>
>> >
>> >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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #5 (permalink)  
Old 08-07-2007, 11:30 PM
Johannes
Tablet PC Guest
 
Posts: n/a
Re: Dynamically replace menu toolbar



"r_z_aret@pen_fact.com" wrote:

> On Mon, 6 Aug 2007 23:46:00 -0700, Johannes
> <Johannes@discussions.microsoft.com> wrote:
>
> >See below.
> >
> >"r_z_aret@pen_fact.com" wrote:
> >
> >> On Mon, 6 Aug 2007 02:24:04 -0700, Johannes
> >> <Johannes@discussions.microsoft.com> wrote:
> >>
> >> >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.

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #6 (permalink)  
Old 08-08-2007, 12:50 PM
r_z_aret@pen_fact.com
Tablet PC Guest
 
Posts: n/a
Re: Dynamically replace menu toolbar

On Wed, 8 Aug 2007 00:19:14 -0700, Johannes
<Johannes@discussions.microsoft.com> wrote:

>
>
>"r_z_aret@pen_fact.com" wrote:
>
>> On Mon, 6 Aug 2007 23:46:00 -0700, Johannes
>> <Johannes@discussions.microsoft.com> wrote:
>>
>> >See below.
>> >
>> >"r_z_aret@pen_fact.com" wrote:
>> >
>> >> On Mon, 6 Aug 2007 02:24:04 -0700, Johannes
>> >> <Johannes@discussions.microsoft.com> wrote:
>> >>
>> >> >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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
No Toolbar/Menu on IE Window Bruce Ogden Internet Explorer 1 05-24-2007 02:10 AM
add program to toolbar or tools menu ? Bill Internet Explorer 1 05-06-2007 07:43 AM
add program to toolbar or tools menu ? Bill Internet Explorer 1 05-06-2007 07:43 AM
menu toolbar in office 2003 sallyanne Microsoft Office 3 01-15-2007 11:32 AM
Toolbar above menu is a kludge isn't it? C. Moya Windows Vista 3 01-02-2007 07:14 AM


All times are GMT -8. The time now is 05:07 AM.


2003 - 2008 All Rights Reserved. Technology Questions

SEO by vBSEO 3.1.0