CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2000
    Posts
    21

    How to detect my window overlapped by another window

    Hi everybody ! I'll try to explain you my problem in the best way I can (I'm not english, of course !)

    In a CFormView, I've inserted a CWnd object (called CArea in my project). In it, I draw everything I want.
    I want to make screen captures of this area but I would like to be sure, before doing the screen captures that the area is entirely visible and not covered by :
    - another window ;
    - the borders of my frame window. When the frame window is not enough large, the border covers my area. I don't want to do the screen capture then !

    What I want is simple : when nothing covers my area, I do the screen capture.

    I hope you've understand my problem. Thanks a lot...


  2. #2
    Join Date
    Oct 2000
    Location
    Prague, Czech Republic
    Posts
    12

    Re: How to detect my window overlapped by another window

    Take a look at
    CWindow::BringWindowToTop()


    to bring the window on the top

    You can also use function SetWindowPos that can be used for all size, position and Z-order changes (Z-order is order of windows, how they overlap)



  3. #3
    igbrus is offline Elite Member Power Poster
    Join Date
    Aug 2000
    Location
    Los Angeles
    Posts
    4,658

    Re: How to detect my window overlapped by another window

    In addition to the previous post you can enumerate all windows via EnumWindows and EnumChildWindows and check their rectangles via GetWindowRect against your window rectangle.


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