I've noticed that after some Windows update, my application made in Delphi 7 does not focus correctly anymore. The title bar does not change color. UI elements like buttons, scrollbars, etc do not react. I also can't minimize or close the Form with the titlebar buttons.
What is weird is that I can still move the Form around by dragging the titlebar, and the program is working fine in general.
Here is an animation showing what is happening:
Here is the list of Windows versions I've tested on:
Windows 7 SP1 + updates -> OK!
Windows 8.1 without updates -> OK!
Windows 8.1 with all updates -> NO FOCUS!
Windows 10 BUILD 10240 -> OK!
Windows 10 BUILD 10586 -> OK!
Windows 10 BUILD 14393 -> NO FOCUS!
I tried disabling Window Ghosting with this code:
var
User32: HMODULE;
DisableProcessWindowsGhosting: TProcedure;
begin
User32 := GetModuleHandle('USER32');
if User32 <> 0 then
begin
DisableProcessWindowsGhosting := GetProcAddress(User32, 'DisableProcessWindowsGhosting');
if Assigned(DisableProcessWindowsGhosting) then
DisableProcessWindowsGhosting;
end;
end;
Also, I removed all Application.ProcessMessages()
calls, but still no change.