🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Minimize Console

#13074
From: Boba
Date: Sat, 25 Oct 2003 18:42
26 lines
1430 bytes
Did you try to GetConsoleTitle, EnumWindows, CloseWindow?
For instance:

HWND hWndCons;
BOOL CALLBACK EnumFunc(HWND hwnd,LPARAM lParam){
  char buff[255];
  /*I like safe coding :-)
  int l;
  l=GetWindowTextLength(hwnd);
  ...
  */
  if(GetWindowText(hwnd,buff,255)){
    if(!lstrcmp(buff,(char*)lParam)){
      hWndCons=hwnd;
      return false;
    }
  }
  return true;
}

  char ConsTitle[255];
  if(!GetConsoleTitle(ConsTitle,sizeof(ConsTitle))) return;
  EnumWindows((WNDENUMPROC)EnumFunc,(LPARAM)ConsTitle);
  if(hWndCons) CloseWindow(hWndCons);

Boba
Technical Details
Message-ID: <3f9ac320@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f7ad06e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,4d3fa09958570568
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-25 11:39:04 PST
From: "Boba" <Boba@somewhere.world>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f7ad06e$1@newsgroups.borland.com>
Subject: Re: Minimize Console
Date: Sat, 25 Oct 2003 13:42:42 -0500
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 208.210.156.38
Message-ID: <3f9ac320@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1067107104 208.210.156.38 (25 Oct 2003 11:38:24 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail