|
Posted by r_z_aret on August 1, 2008, 1:06 pm
Please log in for more thread options
>Thanks for your responding. I did try to subtract the height of the
>menu/command bar, but it came the same result. I'm not creating any
>menu/command bar in MyDialog. When MyDialog is tapped, an empty menu bar
>always covers the command bar of parent window. I also try to get HWND
>of parent command bar and it returns NULL value. I have no way to bring
>the command bar of parent window back once it disappears.
Now I'm confused, so let me take some time to clarify.
I don't call anything a command bar. I assume you mean the bar that's
at the bottom of a Smartphone (AKA Windows Mobile Standard) screen and
contains the menus. I usually call it the menu bar, but I may be
wrong.
I think you have one app with a dialog box, and it opens a child
dialog box you call MyDialog. When MyDialog opens, the menu/command
bar disappears.
Now I'll try to add some actual info.
I have several apps with a main dialog box that opens children. And
the original menu/command bar shows for all of them. I think the only
thing I needed to do was make sure none of the child dialog boxes hid
the menu/command bar. I gave you some hints on that.
If you _do_ find a need to hide or show the menu/command bar, you can
use ShowWindow. The only "tricks" are to use the HWND stored in the
hwndMB member of the SHMENUBARINFO structure you used when you called
SHCreateMenu for the parent dialog box. You may need to call
InvalidateRect first; my code does, but I'm not sure it's necessary.
And you may need to update the desktop window, although I don't.
I tried using SHFindMenuBar, but think that works only when the
menu/command bar is visible.
>
>Thanks,
>
>Dan
>
>r_z_aret@pen_fact.com wrote:
>>
>>> Hi,
>>>
>>> I create a dialog named MyDialog from a parent window and I want to use
>>> the command bar of parent window, not the command bar of MyDialog. It
>>> works fine at beginning when the dialog is created. But when I tap at
>>> the dialog, the command bar of parent window disappears and I'm not able
>>> to bring it back. I have tried to use following function to hide command
>>> bar of MyDialog without success:
>>
>> Why are you creating a menu/command bar at all for MyDialog? If you
>> don't create one, you won't have to hide it.
>>
>>> ::CommandBar_Show(m_hWnd, FALSE);
>>>
>>> And
>>>
>>> SetForegroundWindow();
>>> SHFullScreen(m_hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
>>>
>>> // Resize the window.
>>> RECT rc;
>>> SetRect(&rc, 0, 0, GetSystemMetrics(SM_CXSCREEN),
>>> GetSystemMetrics(SM_CYSCREEN));
>>
>> SM_CYSCREEN gives the height of the whole screen, including the
>> menu/command bar. So you are making MyDialog big enough to cover up
>> the menu/command bar. I think you need to subtract the height of the
>> menu/command bar. I've found that to be 24 for Smartphone/Standard,
>> and GetSystemMetrics( SM_CYMENU ) for other platforms. Or you can use
>> SystemParametersInfo with SPI_GETWORKAREA to get the dimensions you
>> want directly.
>>
>>> MoveWindow(rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE);
>>>
>>>
>>> Please help me to resolve this issue.
>>>
>>> Thank you very much,
>>>
>>> Dan
>>
>> -----------------------------------------
>> 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
|