Article View: borland.public.cppbuilder.nativeapi
Article #13424Re: hide/show system tray question
From: Remy Lebeau (TeamB)
Date: Sun, 12 Oct 2003 03:07
Date: Sun, 12 Oct 2003 03:07
29 lines
2109 bytes
2109 bytes
"Martin C" <martinc@aol.com> wrote in message
news:3f88c3a5$1@newsgroups.borland.com...
> I am using the following code to show/hide taskbar, but I really
> can't find the system tray window handle, or at least how to get
> it by code...do you have any idea how I can accomplish this...
You already have half of the code needed. The system tray is a child of the
taskbar window, whose HWND you already have. You can use FindWindowEx() to
get the system tray HWND from that, ie:
HWND TaskbarWindow = FindWindow("Shell_TrayWnd", NULL);
if( TaskbarWindow != NULL )
{
HWND SystemTrayWindow = FindWindowEx(TaskbarWindow, NULL,
"TrayNotifyWnd", NULL);
if( SystemTrayWindow != NULL )
// use SystemTrayWindow as needed
}
For future reference, whenever you need to work with manipulating windows,
especially windows that are not directly part of your own programs, WinSight
or Spy++ are invaluable tools for determine window relationships,
characteristics, message tracking, etc. WinSight comes with C++Builder,
which Spy++ is a free download from Microsoft's website.
Gambit
Technical Details
Message-ID:
<3f88c52f$1@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-mailReferences:
<3f88ba6b@newsgroups.borland.com> <3f88bd9d$1@newsgroups.borland.com> <3f88c3a5$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,eb5a844aefa46a0c X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-10-11 20:09:05 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f88ba6b@newsgroups.borland.com> <3f88bd9d$1@newsgroups.borland.com> <3f88c3a5$1@newsgroups.borland.com> Subject: Re: hide/show system tray question Date: Sat, 11 Oct 2003 20:07:54 -0700 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 67.22.137.75 Message-ID: <3f88c52f$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1065927983 67.22.137.75 (11 Oct 2003 20:06:23 -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