CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Visual Basic

  1. #1
    Guest

    Visual Basic

    How can I write codes in visual basic to search any other application that are currently running at windows Background ?



  2. #2
    Join Date
    Oct 1999
    Posts
    16

    Re: Visual Basic

    If the application has an visual interface then you could the following.
    You can use the FindWindow and the SetWindowPos APIs to find a window and bring it to focus.
    for eg.,
    Suppose the NotePad or the Calculator application is running behind your application.
    You could use the FindWindow API to search for the NotePad window and return its window handle to you.
    The you could use the SetWindowPos API to bring the NotePad window to focus using the window handle
    returned to you by FindWindow.



  3. #3
    Guest

    Re: Visual Basic

    Hi chilakamati/all,
    My problem is somewhat related to this doubt. I'm trying to find whether a previous instance of an application is running, if so bring it to front when I try to run the same appln. again. I could detect it using the App object's PrevInstance property. But when finding the window handle of the already running app. using FindWindow, which takes the app's title as parameter, it returns the current window's handle itself since it's having the same title... Pls help me how to achieve this! Thanx in adv.

    ---Siva.


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