Getting List of Visible Windows

Hi All,

I am working on a problem that requires me to know whether or not any
part of a particular window is visible (even if it's like a one pixel
corner).  In my misunderstanding, I thought that ::IsWindowVisible
would cover it, but it looks like that call just verifies that the
hWnd actually has a dialog box.  I was able to take it a step further
and find out whether or not a window is minimized using
::GetWindowPlacement, but I really need to find out if a window is
visible or not (in other words, not completely covered by higher
z-order windows).

Is there some sort of API call that will determine this, or do I
actually have to trudge through and do the math (not trivial!) to
figure out if the window is visible/hidden?

Any insights, hints or comments are very welcome!

Thanks,
Bill
0
wpgabriel (2)
9/16/2004 5:31:12 PM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
421 Views

Similar Articles

[PageSpeed] 39

William Gabriel wrote:

> I really need to find out if a window is visible or not (in other words, 
> not completely covered by higher z-order windows).
> 
> Is there some sort of API call that will determine this, or do I
> actually have to trudge through and do the math (not trivial!) to
> figure out if the window is visible/hidden?
> 
> Any insights, hints or comments are very welcome!

Given that you can find all the frame windows using a Win32 
enumerate windows function and given that you can find then 
find the size of each of these frame windows also using the 
Win32 API that would mean you have the answer for two of the 
three unknowns of this equation. 

I read somewhere that the z-order is the return order of the 
enunerated child list for a given parent window.

If this is indeed the case then all the variables of this 
problem are known and it should be easy enough to hand code 
a solution to this problem.

Jussi Jumppanen
Author of: Zeus for Windows (New version 3.93 out now)
"The C/C++, Cobol, Java, HTML, Python, PHP, Perl programmer's editor"
Home Page: http://www.zeusedit.com
0
jussij (16)
9/17/2004 2:55:28 PM
William Gabriel wrote:
> I am working on a problem that requires me to know whether or not
> any part of a particular window is visible (even if it's like a one
> pixel corner).

I found this in MSDN:
KB75236 - "HOWTO: Determine Visible Window Area When Windows Overlap"


0
Alex
9/19/2004 3:48:54 PM
"Alex Blekhman" <tkfx^NOSPAM^@yahoo.com> wrote in message news:<2r5o39F15sm5dU1@uni-berlin.de>...
> William Gabriel wrote:
> > I am working on a problem that requires me to know whether or not
> > any part of a particular window is visible (even if it's like a one
> > pixel corner).
> 
> I found this in MSDN:
> KB75236 - "HOWTO: Determine Visible Window Area When Windows Overlap"

Would you mind posting a link to the article?  I can't find it when I
search for any of the keywords or even when I look for the KB article
number directly.

Thanks,
Bill
0
wpgabriel (2)
9/20/2004 3:16:26 PM
"William Gabriel" <wpgabriel@gmail.com> wrote in message
news:e7ec389e.0409200716.7a839546@posting.google.com...
> "Alex Blekhman" <tkfx^NOSPAM^@yahoo.com> wrote in message
news:<2r5o39F15sm5dU1@uni-berlin.de>...
> > William Gabriel wrote:
> > > I am working on a problem that requires me to know whether or not
> > > any part of a particular window is visible (even if it's like a one
> > > pixel corner).
> >
> > I found this in MSDN:
> > KB75236 - "HOWTO: Determine Visible Window Area When Windows Overlap"
>
> Would you mind posting a link to the article?  I can't find it when I
> search for any of the keywords or even when I look for the KB article
> number directly.

It shows up for me in both VC6 and VC71 msdn's when you search for the
entire quoted string.

Jeff F


0
not1 (120)
9/20/2004 3:19:41 PM
William Gabriel wrote:
>> KB75236 - "HOWTO: Determine Visible Window Area When Windows
>> Overlap"
>
> Would you mind posting a link to the article?

Hm.. I tried to search it and I can't found it, too. Seems that this
article exists only in shipped MSDN. Anyway, here it is:

--------------------------------------------------------
"HOWTO: Determine Visible Window Area When Windows Overlap"

PSS ID Number: 75236

Article Last Modified on 7/9/2000


--------------------------------------------------------
The information in this article applies to:


Microsoft Windows Software Development Kit (SDK)
Microsoft Win32 Software Development Kit (SDK)

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

This article was previously published under Q75236
SUMMARY
There is no Windows API that reports the portion of an application's
window that is not obscured by other windows. To determine which areas
of the window are covered, it is necessary to walk through the window
list managed by Windows.

Each window that precedes the application's window is "above" that
window on the screen. Using the IntersectRect() function, check the
rectangle of the window with any windows above to see if they
intersect. Any window that is above the application's window and
intersects its window rectangle obscures part of the application's
window. By accumulating the positions of all windows that overlap the
application's window, it is possible to determine which areas of the
window are covered and which are not.
MORE INFORMATION
The following sample code demonstrates this procedure:
  GetWindowRect(hWnd, &rMyRect);    /*  Get the window dimensions
                                     *  for the current window.
                                     */
      /*  Start from the current window and use the GetWindow()
       *  function to move through the previous window handles.
       */

  for (hPrevWnd = hWnd;
      (hNextWnd = GetWindow(hPrevWnd, GW_HWNDPREV)) != NULL;
       hPrevWnd = hNextWnd)
    {
      /*  Get the window rectangle dimensions of the window that
       *  is higher Z-Order than the application's window.
       */
    GetWindowRect(hNextWnd, &rOtherRect);

      /*  Check to see if this window is visible and if intersects
       *  with the rectangle of the application's window. If it does,
       *  call MessageBeep(). This intersection is an area of this
       *  application's window that is not visible.
       */

    if (IsWindowVisible(hNextWnd) &&
           IntersectRect(&rDestRect, &rMyRect, &rOtherRect))
      {
      MessageBeep(0);
      }
    }

Keywords: kbhowto kbWndw kbWndwProp KB75236
Technology: kbAudDeveloper kbSDKSearch kbWin32SDKSearch kbWin32sSearch
kbWinSDKSearch
--------------------------------------------------------


0
Alex
9/20/2004 3:50:48 PM
Reply:

Similar Artilces:

How to get ride off this warning ?
Hi: I have a string resource defined. I need to pass this string ID to another function like this: void foo (UINT string_id) { CString str ((LPCTSTR)string_id); } During comiling, got error at casting ((LPCTSTR)string_id. But it works fine. Just wonder, how to get ride off this warning? Thanks In Advance! Polaris use reinterpret_cast<LPCTSTR>(string_id) > Hi: > > I have a string resource defined. I need to pass this string ID to another > function like this: > > void foo (UINT string_id) > { > CString str ((LPCTSTR)string_id); > } > ...

Excel template that lists each month's meetings w/ some detail
I'm looking for an Excel template that lists every month of the year with room to list weekly, monthly and quarterly meetings, including some detail for each meeting. Probably would need to be landscape oriented. The main intent is to give the person using it an idea of upcoming meetings, the intent of each and what prep is required. ...

How to get free traffic to your website
The facts you should know about making money online! Hi , my name is Ben Durandt. -Discover how to get 1 Million visitors without paying a dime in advertising! -Discover how a young 31 years old man just became a millionaire on the Internet... in weeks! He paid cash for a Porsche 911 Carrera convertible and a giant domain with private lake in only 28 days. More than 20,000 people have been raging on his website every day! ... Because he just revealed HOW to do it! Heck, go there TODAY and See what he has to say! Click here : http://www.freeadguru.com/cgi-bin/i.pl?c=a&i=34180 -...

How do I get excel to accept (c) as text and not change to copyri.
How do I enter the text (c) in Excel without having it changed into the copyright symbol? Hi Daffyd, Try: Tools | Autocorrect | Select (c) | Delete | OK --- Regards, Norman "daffyd" <daffyd@discussions.microsoft.com> wrote in message news:8CCC3C1A-6F19-4F62-B934-8A71F236A4FD@microsoft.com... > How do I enter the text (c) in Excel without having it changed into the > copyright symbol? Go into the Tools Menu. Look for AutoCorrect. In the bottom half of the AutoCorrect Tab, look at the list for Replace text as you type. Delete the entry for (c). tj "da...

How do I fix this so I don't get an "Error 2015"
Dim x x = Application.CountIf("E5,E6000", "T13065") How do I fix this so I don't get an "Error 2015" Thanks, Rick Not tried it but I would think x=Application.Countif(Range("E5:E6000"),"T13065") Providing T13065 is a string you are counting. If it's a range reference x=Application.Countif(Range("E5:E6000"),Range("T13065")) -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.ukANDTHIS www.nickhodge.co.uk "2D Rick" <rbrowniii@compuserve.com> wrote in m...

Getting an Error when there is nothing to show
-- The bottom of my report which is a statement shows #Error when there is no Invoices to add up. Can I have it blank instead. this my text Box Control Source thanks for any Help....Bob =Reports!rptOwnerPaymentMethod!subChildOwnerInvoiceAmount!tbAmount.Value Try: =IIf([subChildOwnerInvoiceAmount].[HasData], [subChildOwnerInvoiceAmount].[tbAmount]) Explanation in: Bring the total from a subreport onto a main report at: http://allenbrowne.com/casu-18.html -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.h...

Outlook 2003 Cant get to newsgroups
I dragged the NEWS icon from tools/customize/commands/go to the GO button on the tool bar. It worked fine then I got on a newsgroup and a posting that read "payback" multiple times. I didnot open the attachment. Next time I tryied to go to NEWS it was not there. How can I get newsgroup access back? Tryied reinstalling Outlook2003 and Office 2003 with no luck. Expect the answer to be in registry. Help please. I got the similar problem and got the fix. Here is what you need to do: - add the NEWS button under Go menu - accept Outlook Express is your default NEWS client - c...

I've got a formula for stones and pounds
Hello, I've got a column that displays a series of weights in stones & pounds (both in the one cell). How do I get a chart to recognise and display in the same format? Regards, mikelenno What is the format of the cells with stone & pounds It is best to enter such values a 10 3/14 and format the cells with # ??/14 best wishes from one who is INT(275,14) stone & MOD(250,14) lbs -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "mikelenno" <mikelenno@discussions.microsoft.com> wrote in message news:5AD608FA-5367-4CED-AD76-1F54228EFDBA...

Need help getting this code to compile under VS.NET 2003 (compiles under VS6.0).
I'm tasked with converting a LARGE project from VS6.0 to VS.NET 2003. Here is a VERY scaled down version of an error I'm getting. I must be getting rusty, but the way to get around this compiler error is just not coming to me. If you need to compile this, just create a Win32 console app and specify to add support for MFC, then copy this code into the cpp file and press compile. class CLogItem : public CObject { protected: virtual BOOL CheckConflict(CLogItem* pItem) const; }; struct MapEntry; //forward declaration.. typedef CArray<MapEntry, MapEntry&> CMapEntryArray;...

hyperlinking to an item in Global Address List Options
I have had success linking via html from web page to opening a specific contact record from Microsoft Outlook. I have done it like this: outlook://Big%20Contacts/Contacts/~Peter%20Crawford However, my very large contact database also has people with basically the same name, like John Smith. In the current "Address Card" view inside Microsoft Outlook, one of the John Smith's is always sorted first. If I enter outlook://Big%20Contacts/Contacts/~John%20Smith the first John Smith in the sort order is always opened. However, I want to specify one of the other John Smith's....

Windows Live crap
About 4 days ago I noticed a site called Windows Live ID. It suggested to set up a profile and promised that with a single username and password you could log on to all Windows Live applications such as Hotmail, Windows Live Messenger, Windows Live Mail etc. etc. I thought what a good idea, not having to have 10 different usernames and passwords, so I used my old hotmail adress and username to set up a profile. But the ID said I coildn't use my hotmail for some reason, can't remember what. A few hours later I logged on to Windows Live Messenger as I have done for years, w...

windows update 04-15-10
I am running windows vista on a MAC computer with VMWare Fusion. I cannot get the service pack 1 or internet explorer 8 update to run. i get error code 490 and 800704090 Too late now! Support for Vista Gold (no Service Packs) ended on Tuesday, 13 April 2010! Computers running Vista Gold "will no longer receive software updates from Windows Update" until SP1 has been manually installed (which will require several Prerequisite Updates to be installed first). See http://windowsteamblog.com/blogs/windowsvista/archive/2010/04/13/end-of-support-for-windows-vista-with-no...

I get COMException while exporting chart on IIS 6.0.
I have this code that works perfectly on my development machine when I deployed it at customer site it gets exception. Here is the error and my code: thanks error ========== Exception from HRESULT: 0x800A03EC. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC. Source Error: An unhandled exception was generated during the execution of the c...

How to get a macro to do what i want?
I have designed a form in Excel and the data that is inputted i want to be able to save in a separate worksheet. The problem i am having is that eveytime i record the macro, it over writes the same row each time (if that makes sense). For example if i copied every cell in the form and paste them into the database Row 1, i then want the new piece of information inputted into the form to go into Row 2 and then Row 3 etc.... But it keeps going into Row 1, it wouldnt move down the rows. Hopefully this makes sense to someone and someone can give me some advise. Calculate the last row ...

Conditional Formatting w/ a List/Icons
I am trying to allow someone to select "Green", "Yellow" or "Red" from a list and the cell to display a green/yellow/red icon appropriately. Or, if possible, the user could just select the icon (instead of selecting text). Is this possible? Use Data Validation for the list. Type in Red, Yellow, Green as the list. This give the user the list to select from. Use Conditional Formatting for the fill part. Set three conditions, If Cell Value-"Green" (select a green fill), etc.. -- If this helps, please remember to click yes. "...

Timestamp value of GINA window presentation
I am currently troubleshooting slow logon times for a client with computer infrastructure spread across the globe. Before I start invesagating I want to create a baseline for logon times. I have modified the clients logon script to record when it starts and when it ends. I am using the computers tick count to record how long the computer has been on, but realize that there is a space of time between the user authenicating to the computer (control-alt-delete) and when the logon script starts, if the customer turns his computer on and then leave for an extended period of time I ...

host unreachable after recent Windows Update
Exchange 5.5 on Windows 2000 Server, fully patched and running real swell until Wednesday morning. (Tuesday evening: applied the GDI+ patch: MS04-028.) Didn't find out until later today: internal e-mail is fine, inbound Internet e-mail is fine, but nothing goes out over the IMC. Each outbound e-mail generates Event ID 3010 warning message in the App log: host unreachable. But NSLOOKUP on that very server successfully resolve those same domain names, and ping gets replies. The only other software on this server: GroupShield 5.0 all up-to-date, and VirusScan 8.0.0 patch 1 push...

Install FrontPage 2003 on Windows 7
i tried several times to install, the program told me it has been installed, but it is not. What can I do. On Thu, 1 Apr 2010 10:48:01 -0700, monising <monising@discussions.microsoft.com> wrote: >i tried several times to install, the program told me it has been installed, >but it is not. What can I do. Please be more explicit about what you're doing, what you're seeing, and what error messages - if any - you are getting. I have FrontPage 2003 installed on Windows 7 Ultimate x64, and it's working fine. Also, are you installing from original media? A...

Junk button in windows live accidently pressed
Whenever I open up WLM i press sync automatically as a bad habbit. Because of the loading time, the junk button usually gets inserted before the sync button, pushing it out to the right after its loaded. I therefore accidently press the junk button by accident sometimes. This is a classic Microsoft HCI problem. Surely the button should be there but greyed out when you cant click it. Having buttons moving around in menus is bad in the same way popups are bad. So break your bad habit WLM will sync automatically when 1st opened peter -- If you find a posting or message...

Issue installing FRx 6.7 on Windows 2003
I am encountering an unhandled exception error when attempting the installation. The installation prompts for the language, I select English, then Next. The progress bar makes it all the way to the right of the next screen, then I get the above error. This is a brand new quad CPU Dell OS is base WIndows Server 2003 Enterprise, not SP1 Only installed software is: IIS 6.0 (FTP, WWW, MSMQ) CA ArcServe (backup software) SQL 2000 Enterprise, Analysis Services, both at SP3a WinZip Acrobat 6.0 Reader Hello, Can you give us the exact error message you're receiving (all words and numbers fro...

formula to get sheet name
hi, can a formula retreive a worksheet name or does it need to be macro based? thanks, N.S. Hi Nigel, This formula that takes care of the possible situation whereby you have only one sheet in the workbook and its name is the same as the workbook's. Note: CELL("filename") will only work if the file has been saved at least once and if the file is opened in a different language system, the argument "filename" will need to be changed manually to the corresponding word (e.g. in Spanish "nombrearchivo"): =LOOKUP(REPT("z",255),SUBSTITUTE(MID(CE...

error message in Outlook after running windows and office updates
Hello, I am hoping someone can help me with this. When ever a few staff tries to send a new e-mail, a message "Do you want to save changes" come up and on the back of this message I see the spell checker box come up. The problem is that if you click on "no" on the error message, it comes up with another message something like "running out of memory". I just ran all the windows and office updates on all the machines in the company and so far two employees are having this problem. Is this something to do with the updates? Any suggestions? did you try ...

Outlook should keep files in the clipboard after closing a window
When you open a message (in a new window) in Outlook 2007, and copy one or more files contained in this message, and then close the window, the file is not kept in the clipboard. I have to copy the file and paste it before closing the window. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I ...

OL2003 Master Category List
Anyone know where the master category list is hiding these days. In 2002 it was hkcu\software\microsoft\office\10 \outlook\categories Any help would be appreciated. change 10 to 11. It won't exist unless the user has added something to it and like Outlook 2002 it's a Unicode list so the value is a binary and not a string. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginners Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Dan" <anonymous@discussions.m...

Smart List
This is a multi-part message in MIME format. ------=_NextPart_000_002C_01C4A796.1EC1D910 Content-Type: multipart/alternative; boundary="----=_NextPart_001_002D_01C4A796.1EC1D910" ------=_NextPart_001_002D_01C4A796.1EC1D910 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable BlankIs there any way to get a report in smart list that includes the = serial numbers using inventory transactions or sales transcations? I = have version 7.0 Lisa ------=_NextPart_001_002D_01C4A796.1EC1D910 Content-Type: text/html; charset="Wind...