Re: how to bring dialog to front
- From: r_z_aret@xxxxxxxxxxxx
- Date: Tue, 07 Oct 2008 13:13:29 -0400
On Tue, 7 Oct 2008 08:11:01 -0700, knopper <oneneno@xxxxxxx> wrote:
I can bring my app dialog to forderground, if i my app already started on
smart phone 6.0
When checking whether your app is already running, relying only on
FindWindow is not quite sufficient. An instance of your app may have
just started and has not yet displayed the window. So you will be
slightly "safer" if you use and check a mutex. For more info, use
Google to look for
findwindow mutex
Or check some of the sample code that came with your SDK. At least a
few of the samples I've seen include code to check for uniqueness.
CWnd* pWnd = CWnd::FindWindow(NULL, APP_NAME);
This call will wait until the window responds. So if the previous
instance of your app hangs, so will this call. I think this is at
least somewhat less likely to happen if you rely on window class name
(first argument in FindWindow) rather than caption. I use the full
name of my application as the window class name.
if (pWnd != NULL)
{
if (pWnd->IsIconic())
pWnd->ShowWindow(SW_RESTORE);
if (!pWnd->IsWindowVisible())
pWnd->ShowWindow(SW_SHOW);
//pWnd->m_dlgCommandBar.ShowWindow(SW_SHOW);
exit(1);
}
But i, can't see the menu bar of my app, only the menu of windows (like
contact and phone)
how can i bring the menu bar to forderground with app's dialog ?
I've never seen this symptom, so I don't have a direct solution. My
code calls SetForegroundWindow after calling ShowWindow.
-----------------------------------------
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 400
Boston, MA 02116
www.penfact.com
.
- References:
- how to bring dialog to front
- From: knopper
- how to bring dialog to front
- Prev by Date: Re: disabling sip for a mfc dialog based application
- Next by Date: Re: How can i control joystick on pda
- Previous by thread: how to bring dialog to front
- Index(es):
Relevant Pages
|