Article View: borland.public.cppbuilder.nativeapi
Article #3238Re: Is checking a window's dwStyle-value ' WS_VISIBLE' not sufficent to find out, if a window is currently visible on the screen...
From: JD
Date: Mon, 07 Aug 2006 09:38
Date: Mon, 07 Aug 2006 09:38
56 lines
2741 bytes
2741 bytes
<MR> wrote:
>
> goto overlap_check_passed;
You have got to kidding! A goto?
> Where does this Myapp-window comes from.
VCL applications all have a hidden TApplication window. In
addition, if you're running it from within the IDE, that can
also be an issue depending on how you're searching for windows
because there will be a copy of the main form in the IDE.
However, it's impossible to determine what the problem is with
the code that you posted. You need to post a more complete
sample.
> Why does the IsWindowVisible()-function delivers true,
Again, you didn't post enough code but since you're using the
VCL, why not check the form's Visible property instead? For
example:
std::vector < HWND > vZOrder;
std::vector < TForm* > vForms;
vZOrder.clear();
vForms.clear();
for( int x = 0; x < Screen->FormCount; ++x )
{
if( Screen->Forms[x]->Visible )
{
vForms.push_back( Screen->Forms[x] );
}
}
HWND hWnd = ::GetTopWindow( Application->MainForm->Handle );
while( hWnd )
{
vZOrder.push_back( hWnd );
hWnd = ::GetNextWindow( hWnd, GW_HWNDNEXT );
}
Now you have a vector of the visible forms and a vector of
the same form's (reference by there Handle [hWnd]) in the
correct Z-Order. All you need to do is match them up.
> it just appears in the task-bar.
That is an issue that I would expect to be seperate from the
other problem but the code that's causing it may be embedded
with the other code. Are you overriding the CreateParams
method or using the win32 API SetWindow or SetWindowLong or
related functions?
~ JD
Technical Details
Message-ID:
<44d70a0d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<b91bd2dnjukqfkdkpgtnths0nbltohne89@4ax.com> <2rqbd296n1l0j9o06hftg57cc5ss1dfcki@4ax.com> <omubd2lb4r1nitgalofa70s43i75iubd3v@4ax.com> <fqndd2p35upa7ajicoe59mnos65v8erlqu@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: "JD" <nospam@nospam.com> Sender: "JD" <nospam@nospam.com> Reply-To: "JD" <nospam@nospam.com> 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? Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 64.12.116.201 X-Forwarded-For: 172.161.250.157 References: <b91bd2dnjukqfkdkpgtnths0nbltohne89@4ax.com> <2rqbd296n1l0j9o06hftg57cc5ss1dfcki@4ax.com> <omubd2lb4r1nitgalofa70s43i75iubd3v@4ax.com> <fqndd2p35upa7ajicoe59mnos65v8erlqu@4ax.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <44d70a0d$1@newsgroups.borland.com> Date: 7 Aug 2006 02:38:21 -0700 X-Trace: newsgroups.borland.com 1154943501 207.105.83.66 (7 Aug 2006 02:38:21 -0700) Lines: 57 Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail