View Issue Details

IDProjectCategoryView StatusLast Update
0018480LazarusWidgetsetpublic2017-04-25 09:58
Reportercobines Assigned ToOndrej Pokorny  
Status resolvedResolutionfixed 
PlatformWin32OSWindows XP 
Product Version0.9.31 (SVN) 
Summary0018480: Main form icon dissappears from Alt-Tab task list when form with ShowInTaskBar=stAlways active
DescriptionWith a form with ShowInTaskbar=stAlways is activated the icon for the main form dissappears from the Alt-Tab list. The taskbar buttons stay the same. The behaviour is the same even when I switch ShowInTaskbar for main form from stDefault to stAlways.

I would assume a form with ShowInTaskbar=stAlways behaves like a separate window so I can switch with Alt-Tab between the forms even though it belongs to the same application.
Steps To ReproduceRun attached application.
You will have two taskbar buttons.
Switch to Form2 using Alt-Tab.
Press and hold Alt-Tab - there is no icon for Form1.
Activate Form1 by clicking mouse on it.
Press and hold Alt-Tab - the icon is back.
Fixed in Revision
Attached Files


related to 0018484 acknowledged Taskbar button icon sometimes disappears 
related to 0022587 resolvedOndrej Pokorny Two thumnails on taskbar when ShowInTaskBar is stAlways 
related to 0020864 closedyang jixian ShowInTaskbar = stAlways Bug of MainForm on Windows and TWin32WidgetSet(WidgetSet).AppHandle Bug 
related to 0031248 closedOndrej Pokorny TForm.ShowInTaskBar = stAlways works only when form show on first time, and not work on next times. 


2011-01-12 22:07 (4,531 bytes)


2011-11-11 22:33

reporter   ~0054022

there is hotfix to fix this issue (for

idea behind is that if window should have separate taskbar button it should be parented with desktop window (parent HWND = 0) instead of using extended window style.

This is not a perfect code but it's fully functional, there should be removed usage of FlagsEx and possibly passed additional parameter to create desktop parented window

Also in order to work correctly with Win7 Win+Tab feature main form window also should be desktop parented (no extended style)

2011-11-12 19:46


win32wscontrols.pp.patch (598 bytes)   
Index: win32wscontrols.pp
--- win32wscontrols.pp	(revision 33466)
+++ win32wscontrols.pp	(working copy)
@@ -161,7 +161,12 @@
     FlagsEx := CreateParams.ExStyle;
     Parent := CreateParams.WndParent;
     if (Parent = 0) then
-      Parent := Win32WidgetSet.AppHandle;
+    begin
+      if ((FlagsEx and WS_EX_APPWINDOW) <> 0) then
+        FlagsEx := FlagsEx and not WS_EX_APPWINDOW
+      else
+        Parent := Win32WidgetSet.AppHandle;
+    end;
     StrCaption := CreateParams.Caption;
     Left := CreateParams.X;
win32wscontrols.pp.patch (598 bytes)   

Ondrej Pokorny

2017-04-25 09:58

developer   ~0099900

Fixed in the meantime

Issue History

Date Modified Username Field Change
2011-01-12 22:07 cobines New Issue
2011-01-12 22:07 cobines File Added:
2011-01-12 22:07 cobines Widgetset => Win32/Win64
2011-02-07 20:37 Vincent Snijders LazTarget => -
2011-02-07 20:37 Vincent Snijders Status new => acknowledged
2011-11-11 22:33 VitaliyG Note Added: 0054022
2011-11-12 19:46 VitaliyG File Added: win32wscontrols.pp.patch
2012-10-02 00:29 Juha Manninen Relationship added related to 0020864
2012-10-02 00:33 Juha Manninen Relationship added related to 0018484
2012-10-02 00:35 Juha Manninen Relationship added related to 0022587
2017-04-24 21:44 Juha Manninen Relationship added related to 0031248
2017-04-25 09:39 Juha Manninen Tag Attached: patch
2017-04-25 09:58 Ondrej Pokorny Note Added: 0099900
2017-04-25 09:58 Ondrej Pokorny Status acknowledged => resolved
2017-04-25 09:58 Ondrej Pokorny Resolution open => fixed
2017-04-25 09:58 Ondrej Pokorny Assigned To => Ondrej Pokorny