🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3232

Re: Is checking a window's dwStyle-value ' WS_VISIBLE' not sufficent to find out, if a window is currently visible on the screen...

#3232
From: MR
Date: Sun, 06 Aug 2006 14:37
54 lines
2779 bytes
Bob Gonder <notbg@notmindspring.invalid> schrieb:

>IsWindowVisible()
>You might try using   IsIconic( hwnd)

Again strange: This found 'Myapp'-window delivers 
  true for IsWindowVisible()
and 
  false for IsIconic(),
but
  it isn't visible at the GetWindowRect()-rectangle.

My application's main-window, which is really visible returns the same
results with the functions above.

I finally evaluated the dwStyle of the invisible/visible Myapp-window
and has a value of 
//                    More exactly: this window has the flags
$94CA0000 (<=>
'WS_POPUP|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CAPTION(=WS_BORDER|WS_DLGFRAME)|WS_SYSMENU|WS_GROUP'

I compated this with my app's main-window and there the 
  WS_POPUP-flag 
is not set in the dwStyle-property.

So my test for the rectangle of a window is really visible is now 
  (win_info.dwStyle&WS_VISIBLE)!<=0 && (win_info.dwStyle&WS_POPUP)==0)
where
  win_info 
is the result of GetWindowInfo(hwnd, &win_info) .

This seems to work, but I'm not really happy about it as long as I do
not understand why. So why do the functions above return values, that
signalize the window is visible at it's GetRect()-area?

Thanks,

Michael


P.S. 
 
>Again, it might be helpful to explain what you are trying to
>accomplish, because this sounds like you are trying too hard to do
>something simple.

It's about capturing a window in the background, without wanting to
set the window to be captured in the foreground, because this would
disturb working with other programs in the meantime.  So if the window
is overlapped there is some acustic signal, so the user can move his
window beside. 

So, if you know how to capture an overlapped window, I would really
prefer this solution ;-) 
Technical Details
Message-ID: <omubd2lb4r1nitgalofa70s43i75iubd3v@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <b91bd2dnjukqfkdkpgtnths0nbltohne89@4ax.com> <2rqbd296n1l0j9o06hftg57cc5ss1dfcki@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a9182ef18c390728
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: <MR>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Is checking a window's dwStyle-value ' WS_VISIBLE' not sufficent to find out, if a window is currently visible on the screen?
Date: Sun, 06 Aug 2006 16:37:09 +0200
Message-ID: <omubd2lb4r1nitgalofa70s43i75iubd3v@4ax.com>
References: <b91bd2dnjukqfkdkpgtnths0nbltohne89@4ax.com> <2rqbd296n1l0j9o06hftg57cc5ss1dfcki@4ax.com>
X-Newsreader: Forte Free Agent 3.3/32.846
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 84.57.40.175
X-Trace: newsgroups.borland.com 1154875004 84.57.40.175 (6 Aug 2006 07:36:44 -0700)
Lines: 54
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail