4

I have an MDI app written in Borland C++Builder 6 (upgrading to a newer version is not an option) and am using the ITaskbarList3 interface to integrate the MDI child windows into the Windows 7 taskbar. Following Microsoft's documentation, each MDI window creates a proxy window to receive messages from the Taskbar. The tabs that I register with ITaskbarList3 do appear on the Taskbar, and the proxy windows do receive WM_GETICON, WM_ACTIVATEAPP, WM_SYSCOMMAND, and WM_CLOSE messages. They do not, however, receive any WM_ACTIVATE, WM_DWMSENDICONICTHUMBNAIL, or WM_DWMSENDICONICLIVEPREVIEWBITMAP messages. Without those, the feature is useless.

I thought it might be a manifest issue (the app does use SoftGems TThemeManager), so I extracted a manifest from a C++Builder 2010 app, added a "compatibility" section to mark Vista and Win7 as supported OSes, and replaced the stock manifest in the compiled executable with the new manifest. Still no luck.

Am I missing something?

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • I know nothing at all about Borland's development products. For example, I don't know what `TThemeManager` is... Can you reproduce this otherwise? Say with a plain C or C++ app that targets the Win32 API directly? – Cody Gray - on strike Jul 23 '11 at 10:30
  • I just created a bare-bones app with just straight API calls, and it worked fine! So it has to be an incompatibility either in Borland's code or TThemeManager (since it hooks a bunch of stuff to make Borland's code play nice with XP theming correctly). I will keep digging. – Remy Lebeau Jul 24 '11 at 22:25
  • I removed TThemeManager and its manifest from my main app, and the problem still occurs, so it has to be an issue inside the internals of Borland's VCL code. – Remy Lebeau Jul 24 '11 at 23:05
  • It seems likely to me that the VCL code is catching and suppressing the message, then. Any way that you can single step through it? – Cody Gray - on strike Jul 25 '11 at 03:17
  • 3
    I was able to figure it out. Borland uses a hidden window to control its Taskbar button, but Vista+ do not like that (that's common knowledge, and Borland addressed that a few years ago), but I was not aware that it would also effect the ITaskbarList3 tabs this badly as well. Once I removed the hidden window from the Taskbar and forced the Main window onto the Taskbar (which is also needed for other features, like Flip 3D, to work), everything started working correctly. – Remy Lebeau Jul 25 '11 at 08:52
  • Remy, how did you fix this issue? Did you just remove the WS_EX_APPWINDOW bit from the Application.Handle exstyle? No matter what I try, nothing works for me in Delphi 7 (no chance of upgrading that project to a later version). Thank you! – Dmitry Streblechenko Sep 23 '11 at 21:13
  • I had to do a number of things. When running on Vista+, I clear the TApplication.Title, remove the WS_EX_APPWINDOW style and add the WS_EX_TOOLWINDOW style to the TApplication window, give the MainForm the WS_EX_APPWINDOW style and remove the WS_EX_TOOLWINDOW style, have the MainForm handle the WM_ACTIVATE message to set the TApplication window active when the MainForm is disabled, have the MainForm handle the WM_SYSCOMMAND message to make the MainForm minimze/maximize/restore and to cache document thumbnails/previews when minimized... – Remy Lebeau Sep 24 '11 at 00:36
  • ... When running on Win7+, I call SetCurrentProcessExplicitAppUserModeID(), then allocate a proxy HWND for each open document to handle Taskbar thumbnails/previews, use ChangeWindowMessageFilterEx() to let associated window messages pass through UIPI, and use the ITaskbarList3 interface to make those proxy windows appear on the Taskbar and bring the MainForm to foreground and focus when they are clicked. – Remy Lebeau Sep 24 '11 at 00:41
  • 1
    A lot of that logic was determined by seeing how the VCL handles the TApplication.MainFormOnTaskbar property in newer versions, and then porting that to my project. – Remy Lebeau Sep 24 '11 at 00:44

0 Answers0