Results 1 to 3 of 3

Thread: FindWindow API

  1. #1
    NeilPT
    Guest
    You can use FindWindow as in this code to check if a program (with window caption "XYZ") is already loaded. If it is it swaps focus to that instance and then ends. You also have to declare functions for ShowWindow and BringWindowToTop



    Dim rval As Long
    Dim findhwnd As Long
    Dim strNull As String

    findhwnd = FindWindow(strNull, "XYZ")
    If findhwnd <> 0 Then
    rval = ShowWindow(findhwnd, 1)
    rval = BringWindowToTop(findhwnd)
    End
    End If

  2. #2
    Megatron
    Guest
    FindWindow has been replaced by FindWindowEx, which will allow you to search Child Windows as well as top-level windows.

  3. #3
    Tygur
    Guest
    FindWindow has been replaced by FindWindowEx, which will allow you to search Child Windows as well as top-level windows.
    FindWindow wasn't really replaced. FindWindowEx had been around for a long time, and there is nothing in the MSDN Library telling you that you should start using FindWindowEx all the time, even when you aren't just looking for child windows (If you find any, let me know).

    FindWindowEx is just a supplement to FindWindow for if you want to search child windows (Though it can be used as a replacement, don't get me wrong).

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