Results 1 to 2 of 2

Thread: Determine hwnd of changable window

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    I know that I can use FindWindow to determine the hwnd of an application that has a fixed window name, but what API would I use to determine the hwnd of an app like FreeCell which changes the game number in its window from, for example, "FreeCell Game #1234" to FreeCell Game #3451" depending on the game being played?

    ------------------
    Marty
    Why is it called lipstick if you can still move your lips?

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Marty, why not to search the class name of that window, instead of a caption?

    But if you still need to find the window by it's caption then you can use EnumWindows API to loop through all open windows and then use InStr function to find out if the FreeCell is present.

    ------------------

    Serge

    Programmer Analyst
    [email protected]
    [email protected]
    ICQ#: 51055819


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