CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2001
    Posts
    36

    Find Previous instance of Application?

    is it possible to find the previous instance of my embedded vb 3 application?

    Please help me



  2. #2
    Join Date
    Apr 2001
    Location
    Pondicherry,India 605009
    Posts
    21

    Re: Find Previous instance of Application?

    Hi Greenu Sharma !

    I think you can use App

    object.
    App.PrevInstance

    will give the solution for you.

    I hope this may help you.

    -Poobal

    Do what you Love to do and
    Commit Yourself to doing it in an
    Excellent Fashion

  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Find Previous instance of Application?

    If it has a window fith fixed caption, use findWindow Api (app.previnstance works only in same workspace/dir of startup)

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  4. #4
    Join Date
    May 2001
    Posts
    36

    Re: Find Previous instance of Application?

    Hi,
    Actually am working on embedded Vb 3 in which the app.prevInstance is not working properly.

    My mission is to avoid duplicate instance of a particular exe.
    when i tried to open twice the same exe the windows CE is giving an error "cannot open file "

    I too want the same thing but i want to suppress this message box .

    how can i do this ?

    please help me

    Greenu



  5. #5
    Join Date
    Sep 2003
    Location
    M...N
    Posts
    220

    Re: Find Previous instance of Application?

    I just curious, is FindWindow the best solution for this kind of case?

  6. #6
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: Find Previous instance of Application?

    myron; this question was asked 3 years ago, about a pretty much defunct VB3 ...

    surely there were other more recent articles you could have searched?

    FindWindow finds you a window starting with that exact text.. I have a module that searches for windows starting with some certain text, but still it's not totally reliable because if you have an Explorer window open showing some folder name that is same as your app then it thinks the Explorer folder is your app.. you can look in the process list instead for EXE named the same as yours..
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured