🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Dual monitors. Minimize all window from one of them

#2588
From: Star
Date: Thu, 01 Feb 2007 16:22
53 lines
2282 bytes
Hi Remy,

Thanks for your answer. Ok, I have tried this:

BOOL CALLBACK ewp(HWND hwnd, LPARAM lParam)
{

   long exstyle = GetWindowLong(hwnd, GWL_EXSTYLE);
   if(exstyle & WS_EX_APPWINDOW)
   {
       int length = GetWindowTextLength(hwnd);
       char *ch = new char[length];
       GetWindowText(hwnd, ch, length);
       Form1->Memo1->Lines->Add(ch);
       delete[] ch;
   }

   return true;

}


void __fastcall TForm1::Button1Click(TObject *Sender)
{
   EnumWindows((WNDENUMPROC)ewp, NULL);
}

For some reason it shows windows that were close sometime ago and it 
doesn't show the tasks that I have currently in the taskbar.
Am I missing something?

Thanks



Remy Lebeau (TeamB) wrote:
> "Star" <noemai@noemail.com> wrote in message
> news:45c11e55$1@newsgroups.borland.com...
> 
>> I have tried using Enumwindows, but I get a huge list of
>> windows and not the ones that are in the taskbar.
> 
> You are not taking into account that EnumWindows() returns all
> available top-level windows, including hidden windows, regardless of
> monitor.  If you only want windows that appear in the TaskBar, then
> use GetWindowLong() to filter out the HWNDs that do not have the
> WS_EX_APPWINDOW style.  To filter out HWNDs by specific monitor, use
> MonitorFromWindow() as well.
> 
> 
> Gambit
> 
> 
Technical Details
Message-ID: <45c21372$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45c11e55$1@newsgroups.borland.com> <45c13d7e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,3994b9dccccaa5ca
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 01 Feb 2007 11:22:00 -0500
From: Star <noemai@noemail.com>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Dual monitors. Minimize all window from one of them
References: <45c11e55$1@newsgroups.borland.com> <45c13d7e$1@newsgroups.borland.com>
In-Reply-To: <45c13d7e$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 209.227.134.122
Message-ID: <45c21372$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1170346866 209.227.134.122 (1 Feb 2007 08:21:06 -0800)
Lines: 53
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail