View Issue Details

IDProjectCategoryView StatusLast Update
0020864LazarusLCLpublic2014-10-16 04:12
Reporteryang jixianAssigned Toyang jixian 
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.31 (SVN)Product Build 
Target Version1.3 (SVN)Fixed in Version1.3 (SVN) 
Summary0020864: ShowInTaskbar = stAlways Bug of MainForm on Windows and TWin32WidgetSet(WidgetSet).AppHandle Bug
DescriptionWhen set Application.MainForm.ShowInTaskbar := stAlways, MainForm button on taskbar disappeared when minimized.
It should never disappear.

Another bug is TWin32WidgetSet(WidgetSet).AppHandle. If it is set to SW_HIDE in application, it should never appear on taskbar no matter minimized or restored or something else.

It is terrible on TWin32WidgetSet(WidgetSet).AppHandle that when SetWindowLong(TWin32WidgetSet(WidgetSet).AppHandle, GWL_EXSTYLE,
    GetWindowLong(TWin32WidgetSet(WidgetSet).AppHandle, GWL_EXSTYLE)
    or WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
It still has the ability to show on taskbar.

The bug can not be found on Turbo Delphi.




TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64
Attached Files
  • intaskbar.patch (1,006 bytes)
    Index: win32callback.inc
    ===================================================================
    --- win32callback.inc	(revision 38499)
    +++ win32callback.inc	(working copy)
    @@ -797,7 +797,7 @@
     
           SC_MINIMIZE:
             begin
    -          if Assigned(Application) then
    +          if Assigned(Application) and not (Application.MainForm.ShowInTaskBar = stAlways) then
               begin
                 if Assigned(lWinControl) and (Application.MainForm = lWinControl) and not Application.MainFormOnTaskBar then
                   Window := Win32WidgetSet.AppHandle;//redirection
    Index: win32wsforms.pp
    ===================================================================
    --- win32wsforms.pp	(revision 38499)
    +++ win32wsforms.pp	(working copy)
    @@ -645,8 +645,6 @@
     begin
       if not WSCheckHandleAllocated(AForm, 'SetShowInTaskbar') then
         Exit;
    -  if Assigned(Application) and (AForm = Application.MainForm) then
    -    Exit;
     
       OldStyle := GetWindowLong(AForm.Handle, GWL_EXSTYLE);
       NewStyle := OldStyle;
    
    intaskbar.patch (1,006 bytes)

Relationships

related to 0017311 closedPaul Ishenin Patches There is no MainFormOnTaskBar property in Lazarus 
related to 0017294 resolvedOndrej Pokorny Lazarus ShowInTaskBar = stNever does nothing 
related to 0018480 resolvedOndrej Pokorny Lazarus Main form icon dissappears from Alt-Tab task list when form with ShowInTaskBar=stAlways active 

Activities

yang jixian

2011-12-13 15:41

developer   ~0055012

Without the bug, we can implement the perfect MainFormOntaskbar on Lazarus like on Turbo Delphi, in which the main form is no longer under all others. It seems better than the implementation of all of the later Delphi.

SetWindowLong(Application.Handle, GWL_EXSTYLE,
    GetWindowLong(Application.Handle, GWL_EXSTYLE)
    or WS_EX_TOOLWINDOW // remove app from the Alt+Tab window
    and not WS_EX_APPWINDOW); // remove app from the taskbar

yang jixian

2011-12-13 15:47

developer   ~0055013

Or the best MainFormOntaskbar is no such property.

Paul Ishenin

2012-03-14 03:44

manager   ~0057612

Sorry, but what is bad with the current implementation of

MainFormOnTaskBar property? Did you try to set it instead of playing with ShowInTaskbar = stAlways?

yang jixian

2012-09-03 16:31

developer   ~0062048

When MainFormOnTaskBar is true, no problem.
But when it is false, mainform disapeared on minimize.

2012-09-03 18:05

 

intaskbar.patch (1,006 bytes)
Index: win32callback.inc
===================================================================
--- win32callback.inc	(revision 38499)
+++ win32callback.inc	(working copy)
@@ -797,7 +797,7 @@
 
       SC_MINIMIZE:
         begin
-          if Assigned(Application) then
+          if Assigned(Application) and not (Application.MainForm.ShowInTaskBar = stAlways) then
           begin
             if Assigned(lWinControl) and (Application.MainForm = lWinControl) and not Application.MainFormOnTaskBar then
               Window := Win32WidgetSet.AppHandle;//redirection
Index: win32wsforms.pp
===================================================================
--- win32wsforms.pp	(revision 38499)
+++ win32wsforms.pp	(working copy)
@@ -645,8 +645,6 @@
 begin
   if not WSCheckHandleAllocated(AForm, 'SetShowInTaskbar') then
     Exit;
-  if Assigned(Application) and (AForm = Application.MainForm) then
-    Exit;
 
   OldStyle := GetWindowLong(AForm.Handle, GWL_EXSTYLE);
   NewStyle := OldStyle;
intaskbar.patch (1,006 bytes)

yang jixian

2012-09-03 18:06

developer   ~0062050

The patch solved the problem.

yang jixian

2014-10-16 04:12

developer   ~0078266

fixed.

Issue History

Date Modified Username Field Change
2011-12-10 09:30 yang jixian New Issue
2011-12-10 09:30 yang jixian LazTarget => -
2011-12-10 09:30 yang jixian Widgetset => Win32/Win64
2011-12-13 15:30 yang jixian Relationship added related to 0017311
2011-12-13 15:41 yang jixian Note Added: 0055012
2011-12-13 15:44 yang jixian Relationship added related to 0017294
2011-12-13 15:47 yang jixian Note Added: 0055013
2012-03-13 08:25 Zeljan Rikalo Status new => assigned
2012-03-13 08:25 Zeljan Rikalo Assigned To => Paul Ishenin
2012-03-14 03:44 Paul Ishenin Note Added: 0057612
2012-03-14 03:44 Paul Ishenin Status assigned => feedback
2012-09-03 16:31 yang jixian Note Added: 0062048
2012-09-03 18:05 yang jixian Status feedback => assigned
2012-09-03 18:05 yang jixian Assigned To Paul Ishenin => yang jixian
2012-09-03 18:05 yang jixian File Added: intaskbar.patch
2012-09-03 18:06 yang jixian Note Added: 0062050
2012-10-02 00:29 Juha Manninen Relationship added related to 0018480
2014-10-16 04:12 yang jixian Note Added: 0078266
2014-10-16 04:12 yang jixian Status assigned => closed
2014-10-16 04:12 yang jixian Resolution open => fixed
2014-10-16 04:12 yang jixian Fixed in Version => 1.3 (SVN)
2014-10-16 04:12 yang jixian Target Version => 1.3 (SVN)