🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: ShowWindow question

#13290
From: Bob Gonder
Date: Sat, 18 Oct 2003 07:41
23 lines
1925 bytes
Martin C wrote:

>I am trying to use ShowWindow function with SW_HIDE, SW_SHOW in order to
>hide/show applications from its handle. my problem comes after hiding the
>application as I can't restore it again.
>
>HWND AppHandle= SearchProgramHandle("notepad.exe");
>//(SearchProgramHandle) is a function that take a snapshot of the current
>windows process and search for the application handle based on its exe name
>
>can someone help me please and tell me what I am doing wrong here...or what
>I am missing exactly....

If you simply hang onto the handle, you should see it work ok...
ShowWindow(handle,SW_HIDE);
Sleep(5000);
ShowWindow(handle,SW_SHOW);

Your problem is in SearchProgramHandle().  You don't show the code,
but I'm guessing that you are using EnumWindows() to search, which
might not work. (enumerates all windows on the screen, but hidden
windows aren't on the screen, so...)
You'll need to show your actual search code.
Technical Details
Message-ID: <srq1pvg3emp51jq97kjt2tkaqv8uoa5cpm@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f90a515@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,644d4ac8e2f18824
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-18 01:08:57 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: ShowWindow question
Date: Sat, 18 Oct 2003 00:41:21 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <srq1pvg3emp51jq97kjt2tkaqv8uoa5cpm@4ax.com>
References: <3f90a515@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.165.216
X-Trace: newsgroups.borland.com 1066462883 67.31.165.216 (18 Oct 2003 00:41:23 -0700)
Lines: 25
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail