Re: How can I know when the application is running?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

r_z_aret_at_pen_fact.com
Date: 12/07/04


Date: Tue, 07 Dec 2004 14:27:51 -0500

On Mon, 6 Dec 2004 14:51:06 -0800, "Miguel Arenas"
<MiguelArenas@discussions.microsoft.com> wrote:

>Who can I use this code en VB.net ?
>I never Use C# or C+

You would save everyone a lot of time by mentioning your development
tool(s) right away.

This is a _very_ common problem. So similar questions have been asked
and answered often. Unfortunately, the question is asked in so many
different ways that I, at least, had a hard time finding a good search
string for google.

You will get at least a small lead if you check a 18 Nov 04 thread
called "reenter cf application" in this newsgroup

Check the sample code that came with vb.net. I know the samples for
eVC 4 includes some good code.

I just used google (http://groups.google.com/advanced_group_search) to
look up
single instance
in this newsgroup starting in May 2004, and got 4 hits. Three look
relevant for eVB and eVC users. I don't use .NET, so I can't judge how
relevant they might be for you.

I also used google to look up
single instance cf.net
with no restrictions and got 1 hit. That looks _very_ relevant.

>
>"Andre Oschadlin" wrote:
>
>> Hi Miguel
>>
>> Something like this might help you, when placed in your InitInstance
>> function....
>>
>> //If it is already running, then focus on the window
>> hWnd = FindWindow(szWindowClass, szTitle);
>> if (hWnd)
>> {
>> // set focus to foremost child window
>> // The "| 0x01" is used to bring any owned windows to the foreground and
>> // activate them.
>> SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001));
>> return 0;
>> }
>>
>> Andre
>>
>> "Miguel Arenas" <MiguelArenas@discussions.microsoft.com> wrote in message
>> news:64AFD2E0-65D3-4259-B861-75307FA251F1@microsoft.com...
>> > This is beacuse everytime when the user don't use ppc the aplication is
>> > minimize and he start a application againg, loading the application a lot
>> > a
>> > times.
>> > I need to know when the application is already in memory.
>>
>>
>>

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com



Relevant Pages

  • Re: Compile Windows App for Windows CE
    ... I just used google to ... in this newsgroup and got 424 hits. ... Windows CE is a subset of Win32, ...
    (microsoft.public.windowsce.app.development)
  • Re: Paging File, can this be moved from the C: partition ??
    ... >> got *thousands* of hits for each. ... >> Ken Blake - Microsoft MVP Windows: ... >> Please reply to the newsgroup ... Google is an invaluable resource. ...
    (microsoft.public.windowsxp.general)
  • Re: Can we activate ActiveSync Synchronization programatically
    ... I just used google to ... and got 72 hits. ... >What would be the choices for copying files b/w PPC and Desktop from within ... remove the underscores from my email address (and please indicate which newsgroup and message). ...
    (microsoft.public.pocketpc.developer)
  • Re: installmw.exe on Vista DVD???
    ... be what Google does nowadays. ... Prior to my newsgroup posting, ... hits in "groups." ... promptly display. ...
    (microsoft.public.windows.vista.mail)
  • Re: Giving an application a window icon in a sensible way
    ... "ClassLoader.getResource" when you saw it in excerpts by search hits, ... Search engines then end up good for finding references for stuff you ... engines to a test on them, mainly Google Image Search. ... Step 5, Fix the third party tool, because it was broken. ...
    (comp.lang.java.programmer)