Article View: borland.public.cppbuilder.nativeapi
Article #9942Re: A separete window for the task bar than one for the main form?
From: Art Alvarado
Date: Tue, 01 Jun 2004 00:47
Date: Tue, 01 Jun 2004 00:47
53 lines
2725 bytes
2725 bytes
"Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> wrote in message
news:40bbca8d$1@newsgroups.borland.com...
> I don't know for sure what happened with your program but my guess is
> that you've discovered the hidden window that the VCL creates.
>
Ahh, a secret, I like Secrets, To bad it doesn't seem to be all that useful.
I did add the Class name to the list, and it does create a Window for the
class TForm and a Window for the class TApplication.
My form has two components a Button to generate the list, and a ListBox to
fill with the Window list.
Here is the sample code:
static BOOL CALLBACK EnumWindowsProc( HWND hwnd, LPARAM lParam )
{
if (IsWindowVisible(hwnd))
{
char WClassName[200];
char WTitleText[200];
if ( GetWindowText(hwnd,WTitleText, 200))
{
TListBox *WLB = (TListBox *) (lParam);
DWORD thread_id;
GetWindowThreadProcessId(hwnd,&thread_id);
GetClassName(hwnd,WClassName, 200);
AnsiString text = AnsiString((unsigned int)hwnd) +" " +
AnsiString(WTitleText) + " " + AnsiString(WClassName);
WLB->Items->Add(text);
}
}
return true;
}
//--------------------------------------------------------------------------
-
void __fastcall TForm1::GetWindowList_BtnClick(TObject *Sender)
{
WindowsListBox->Clear();
EnumWindows((WNDENUMPROC) EnumWindowsProc, (LPARAM)WindowsListBox );
}
//--------------------------------------------------------------------------
-
void __fastcall TForm1::WindowsListBoxClick(TObject *Sender)
{
AnsiString text =
WindowsListBox->Items->Strings[WindowsListBox->ItemIndex];
int pos = text.AnsiPos(" ");
AnsiString subs = text.SubString(0,pos -1);
unsigned int hnd = subs.ToInt();
FlashWindow((void *)hnd,true);
}
Technical Details
Message-ID:
<40bbd38e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40bbc56e@newsgroups.borland.com> <40bbca8d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,d30cc5d29b00abe2 X-Google-Attributes: gid10cc67,public Reply-To: "Art Alvarado" <gug@gug.net> From: "Art Alvarado" <gug@gug.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <40bbc56e@newsgroups.borland.com> <40bbca8d$1@newsgroups.borland.com> Subject: Re: A separete window for the task bar than one for the main form? Date: Mon, 31 May 2004 18:47:51 -0600 Lines: 55 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 200.30.148.162 Message-ID: <40bbd38e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1086051214 200.30.148.162 (31 May 2004 17:53:34 -0700) Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail