Re: how to bring dialog to front

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: Only One Instance.
    ... the secondary app the handle info of the original app along with what ... use the FINDWIndow in the Main Source before The ... The name of the mutex has no effect on anything else in your program, ... Creating a window, on the ...
    (comp.lang.pascal.delphi.misc)
  • Re: FindWindow is hanging....
    ... because any string you have depends on the fact that you are looking for a specific window ... in a specific version of the app, ... Since I don't trust FindWindow as far as I can throw a mainframe, ...
    (microsoft.public.vc.mfc)
  • Re: passing multiple parameters to an application via windows explorer
    ... >> Thanks for the reply Jamie, but my problem isn't working out how to ... > main program via the createProcess, then a findWindow can be done ... > again to get the window handle of the main program. ... > to the window of your main app, ...
    (alt.comp.lang.borland-delphi)
  • Re: Only One Instance.
    ... use the FINDWIndow in the Main Source before The ... you could simply create a mutex. ... created the window that the other process is looking for. ... > your app responed to .. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Steve Carroll does not know the difference between saving and quitting.
    ... or in an app where it can be used for additional work it ... Most apps cannot be used with no window open... ... yet it does not quit. ... And nor should it Snit! ...
    (comp.sys.mac.advocacy)