CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Location
    where Eurasian, Pacific and Philippine tectonic plates meet
    Posts
    229

    Get client area from another app window

    I need to get access to the client area of another window (ie from a window *not* from my program) in order to read the graphical data.

    - what is the way to do that provided that I know the name (title) of the window?

    Thx
    "Such ingratitude after all the times I saved your life." (imdb quotes)
    A bit of history.

  2. #2
    Join Date
    Nov 2005
    Location
    Thrissur
    Posts
    96

    Re: Get client area from another app window

    You can use FindWindow to get the handle of the window.

    Once you get the handle of the window you can use GetClientRect or GetWindowRect according to your need.
    If this post Helped you,pls rate this post.

    Everything Happens for a Reason.
    Enjoy every moment .

    Regards
    HariCmenon
    (Hariharasuthan.c)
    http://www.geocities.com/hhsuthan123/

  3. #3
    Join Date
    May 2005
    Posts
    4,954

    Re: Get client area from another app window

    Quote Originally Posted by Mercantilum
    I need to get access to the client area of another window (ie from a window *not* from my program) in order to read the graphical data.

    - what is the way to do that provided that I know the name (title) of the window?

    Thx
    What kind of data you want to get for the window? Textual? Graphical? What kind of window is that?

    Cheers
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

  4. #4
    Join Date
    Feb 2004
    Location
    where Eurasian, Pacific and Philippine tectonic plates meet
    Posts
    229

    Re: Get client area from another app window

    golanshahar: it's in my initial post.... read it again

    haricmon: thanks. but you missed the FindWindowEx allowing search of child windows. you are the nearer from the solution (that i didn't know initially, but had to find the answer myself in the meantime
    "Such ingratitude after all the times I saved your life." (imdb quotes)
    A bit of history.

  5. #5
    Join Date
    May 2005
    Posts
    4,954

    Re: Get client area from another app window

    Quote Originally Posted by Mercantilum
    golanshahar: it's in my initial post.... read it again
    Sorry missed that .

    What kind of graphical information you want to get? You want to capture images from that window?

    Cheers
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

  6. #6
    Join Date
    Feb 2004
    Location
    where Eurasian, Pacific and Philippine tectonic plates meet
    Posts
    229

    Re: Get client area from another app window

    Quote Originally Posted by golanshahar
    What kind of graphical information you want to get? You want to capture images from that window?
    Cheers
    Hi... actually everything is graphic at the window client level ... I will use GetClientRect etc... to get the data which is actually a graphic
    "Such ingratitude after all the times I saved your life." (imdb quotes)
    A bit of history.

  7. #7
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Get client area from another app window

    There are many ways to get the client data. FindWindow, FindWindowEx, EnumWindows, EnumChildWindows and more gets the top or child windows. From there use the other windows functions to get other data (such as GetClientRect).
    If you know the process id, use the EnumXXX methods to restrict the search to a specific process. This method is more reliable (so you don't accidentally grab the 'wrong' window from a process you aren't interested in).

    Another way to increase the reliability is to specify the window class along with the title.

    If I missed anything here, please don't chastise me - I'm just trying to help.

    Arjay

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