I just find this out that buzz me a bit. I am use WM 5, CDialog as main
window

If I use SHFindMenuBar w/o call SHCreateMenuBar, then I still get a
non-NULL HWND, then I can use it to add string w/ TB_ADDSTRING and call
TB_ADDBUTTONS successfully, and I got my new menu on the Command Bar.
However, I cannot add bitmap using command Bar_AddBitmap. It always
return -1.

But if I first call SHCreateMenuBar, then I can add string and bitmap
ok; however, the menu has old interface that menus are on the left, and
the SIP is on the right vs w/ situation above that SIP stay in the
middle and 2 menus are on 2 side.

Does anyone has any explaintation to this?

Re: SHFindMenuBar vs SHCreateMenuBar and CommandBar_AddBitmap vs TB_ADDSTRING by Yaroslav

Yaroslav
Mon Mar 13 02:50:10 CST 2006

Yes, you should use SHCreateMenuBar to create Windows Mobile 5 menu bar
(with two soft keys). The following remark from MSDN should resolve your
issue:

"In Windows Mobile 5.0, a soft key bar will be automatically created if the
specification passed to SHCreateMenuBar function contains 2 or less top
level menu items and those menu items do not contain images.
If the specification passed to SHCreateMenuBar function contains images or
more than 2 top level menu items, the behavior is as follows."


--
Yaroslav Goncharov
Spb Software House


"daicamad" <nguyent@fit.edu> wrote in message
news:1142223712.983075.10140@v46g2000cwv.googlegroups.com...
>I just find this out that buzz me a bit. I am use WM 5, CDialog as main
> window
>
> If I use SHFindMenuBar w/o call SHCreateMenuBar, then I still get a
> non-NULL HWND, then I can use it to add string w/ TB_ADDSTRING and call
> TB_ADDBUTTONS successfully, and I got my new menu on the Command Bar.
> However, I cannot add bitmap using command Bar_AddBitmap. It always
> return -1.
>
> But if I first call SHCreateMenuBar, then I can add string and bitmap
> ok; however, the menu has old interface that menus are on the left, and
> the SIP is on the right vs w/ situation above that SIP stay in the
> middle and 2 menus are on 2 side.
>
> Does anyone has any explaintation to this?
>



Re: SHFindMenuBar vs SHCreateMenuBar and CommandBar_AddBitmap vs TB_ADDSTRING by daicamad

daicamad
Mon Mar 13 15:57:18 CST 2006

Thanks :^)