Archive

Posts Tagged ‘Fix’

Fix for ShellLink & Minimized Forms under < D2007

September 15th, 2008

Hello,

you probably know of the tutorials Nathanial Woolls of InstallationExcellence has published some time ago regarding the Vista Issues under Delphi Versions below D2007 (available here and here).

As I’ve just checked Andreas Hausladen’s QC report #58939 which deals with the fact that Applications created by Delphi 2007 have no Taskbar Button when started minimized using the ShellLink, I’ve discovered that the same applies for anything below D2007 using the above mentioned Vista tweaks of InstallationExcellence:

You’ll receive a minimized TApplication Window on the desktop with no Taskbar Button assigned to it.

After stepping through the VCL sources of D2006 I saw that the problematic part is in TApplication.Run where CmdShow = SW_SHOWMINNOACTIVE is checked and a few lines below “Minimize;” is called.

Together with Nathanial’s fix this won’t do. To circumvent it you will have to make a small addition to his fix in order to have a correct behaviour together with minimized ShellLinks:

ShowWindow(Application.Handle, SW_HIDE);
SetWindowLong(Application.Handle, GWL_EXSTYLE,
GetWindowLong(Application.Handle, GWL_EXSTYLE) and not
WS_EX_APPWINDOW or WS_EX_TOOLWINDOW);
ShowWindow(Application.Handle, SW_SHOW);

// add the following lines:
if (CmdShow = SW_SHOWMINNOACTIVE) then
Application.ShowMainForm := False;

Assuming you are using Nathanial’s fix correctly in the MainForm’s OnCreate the given lines ensure that the MainForm is already hidden before Application.Run has been called.

Arvid Delphi ,

Delphi Resize & Drawing Problems with x64 Windows

September 12th, 2008

Hi,

for all of you who discovered some resizing and or drawing bugs with Delphi under x64 Operating Systems have a look at the post in Jordan Russell’s Forum.

The bug is related to a stack overflow condition in the Windows kernel arising when a WH_CALLWNDPROC hook is installed. Regarding to Jordan’s post this reduces the time SendMessage() can be called recursively.

The good news: Andreas Hausladen has also published a fix for this issue.

This fixes not only problems with Jordan’s Tb2k but also Robert Lee’s SpTBXLib under x64 Vista as posted in jrsoftware.toolbar2000.thirdparty newsgroup on July, 23rd 2008.

Using the patch is as easy as adding a single unit to your project’s .dpr file:

uses
ControlResizeBugFix;

Thanks Andreas for providing the fix and Robert Lee for pointing to it!

Arvid Delphi ,