On approximately 6/25/2003 7:04 AM, came the following characters from
the keyboard of Frazier, Joe Jr:
>>-----Original Message-----
>>From: Glenn Linderman [mailto:[EMAIL PROTECTED]
>>Sent: Tuesday, June 24, 2003 10:07 PM
>>To: Win32 GUI
>>Subject: [perl-win32-gui-users] no taskbar entry for a Win32::GUI
>>program
>>
>>
>> From time to time the question has been asked on this list
>>about how to
>>have a Win32::GUI program running, but have no entry in the taskbar.
>>
>>When hidden and disabled, no entry will appear, but when shown or
>>enabled, it will come back.
>>
>>Unless, when you create the window, you use:
>>
>> -toolwindow => 1,
>>
>>There is a more complicated solution, involving creating a fake main
>>window, making a real main window with the fake main window
>>as a parent,
>>and then deleting the fake main window. This technique also
>>works, but
>>is much more complex than the option above.
>
>
>
> Glenn, I have not tried the above, but if it is what I "think" it is,
then the third solution (one I currently use in an application) is to
have your minimize and maximize events explicitly call hide() and
disable() / show() and Enable() respectivly. I wrap these up (with
other stuff) in a if ($window->IsVisable()) block:
>
> sub Window_Minimize {
> if ($Window->IsVisible){
> logit ("Window is Visible\n") if ($debug);
> $Window->Disable();
> logit ("Window Disabling\n") if ($debug);
> $Window->Hide();
> logit ("Window Hiding\n") if ($debug);
> $Window->CenterOnScreen(); #### Custom function added so it can
be called as a method (it is a hack and probably not a good idea, but it
does what I need it to do with no problems)
> $Window->NI->Modify( -id => 1, -tip => "Show PCKeys");
> $PopupMenu->{RestoreItem}->Enabled(1);
> $PopupMenu->{CloseItem}->Enabled(0);
> return 0;
> }
> }
>
>
> Then, since it is not visable in Task bar, etc, the only way to get
back is via my TrayIcon and here I put code to reverse the process:
>
> ub NI_Click { ##### NI is the name of the trayICON
> if ($Window->IsVisible){
> $Window->Disable();
> $Window->Hide();
> $Window->CenterOnScreen(); #### Custom function added so it can
be called as a method (it is a hack and probably not a good idea, but it
does what I need it to do with no problems)
>
> $Window->NI->Modify( -id => 1, -tip => "Show PCKeys");
> $PopupMenu->{RestoreItem}->Enabled(1);
> $PopupMenu->{CloseItem}->Enabled(0);
> return 1;
> }
> else {
> $Window->NI->Modify( -id => 1,-tip => "Hide PCKeys");
> $PopupMenu->{RestoreItem}->Enabled(0);
> $PopupMenu->{CloseItem}->Enabled(1);
> $Window->Enable();
> $Window->CenterOnScreen(); #### Custom function added so it can be
called as a method (it is a hack and probably not a good idea, but it
does what I need it to do with no problems)
> $Window->Show();
> $Window->SetForegroundWindow();
> $CBdropdown->SetFocus();
> return 1;
> }
> }
>
> When I get around to it, I will try your find. Thanks!
Hi Joe,
My second paragraph attempted to briefly describe that solution....
which doesn't eliminate the task bar window during use of a window, but
does eliminate it while it is hidden and disabled. That is a nice
technique for programs that use a NotifyIcon as their interface when
they are hidden from the screen, yet would like one or more of their
windows to have task bar entries when they do appear on the screen.
That technique has been described before, which is why I gave it so
little discussion area, although it has been a good while now, so your
redscription of the technique is not inappropriate.
Rather, I was focusing on the slightly different question of how to have
a window that _never_ appears in the taskbar, which is what "-toolwindow
=> 1" achieves. This technique is useful for programs that use the
NotifyIcon as their interface when they are hidden from the screen, and
that probably only have one window at a time displayed, and don't feel
the need to have that window appear in the task bar (perhaps clicking
the NotifyIcon brings to the the front, so the task bar entry is not
needed).
Hopefully, some of this thread might make it in to the new documentation
project, somewhat edited for the different nature of documents vs
newsthreads.
--
Glenn -- http://nevcal.com/
===========================
Wise men talk because they have something to say.
Fools talk because they have to say something." -- Plato