imagen de las cámaras¿Por qué este error sigue estropeando las barras de herramientas XE2 IDE?
El siguiente código fuente se utilizó para producir el error anterior. Todo lo que tiene que hacer es compilar el programa y asegurarse de que el IDE aún se está ejecutando (el error NO ocurre si el IDE está cerrado), haga clic en el botón de 12 a 15 veces y aparecerá el error.
Una vez que se ha producido el error, vuelva a cambiar al IDE, todas las barras de herramientas para el IDE han desaparecido. Tienes que cerrar el IDE y ejecutar de nuevo, para que vuelvan a aparecer. Pantalla
Código Fuente
unit MainUnit;
interface
uses
Winapi.Windows, Winapi.Messages, Winapi.ShlObj, System.SysUtils,
System.Variants, System.Classes, System.StrUtils, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.StdCtrls;
type
TMainFrm = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainFrm: TMainFrm;
hDesktop: HWND;
implementation
{$R *.dfm}
function GetHandle(theHandle: HWND; NotUsed: NativeInt): LongBool; stdcall;
begin
if (theHandle <> 0) then
begin
hDesktop := FindWindowEx(FindWindowEx(theHandle, 0, 'SHELLDLL_DefView',
nil), 0, 'SysListView32', nil);
end;
Result := (hDesktop = 0);
end;
procedure TMainFrm.FormCreate(Sender: TObject);
var
lpss: TShellState;
begin
ZeroMemory(@lpss, SizeOf(lpss));
try
SHGetSetSettings(lpss, SSF_HIDEICONS, False);
finally
Button1.Caption := IfThen(lpss.fHideIcons, 'Show Icons', 'Hide Icons');
end;
EnumWindows(@GetHandle, 0);
Button1.Enabled := (hDesktop <> 0);
end;
procedure TMainFrm.Button1Click(Sender: TObject);
const
nCmdShow: array [Boolean] of NativeInt = (SW_HIDE, SW_SHOW);
var
lpss: TShellState;
begin
ZeroMemory(@lpss, SizeOf(lpss));
try
SHGetSetSettings(lpss, SSF_HIDEICONS, False);
ShowWindow(hDesktop, nCmdShow[lpss.fHideIcons]);
lpss.fHideIcons := (not BOOL(lpss.fHideIcons));
Button1.Caption := IfThen(lpss.fHideIcons, 'Show Icons', 'Hide Icons');
finally
SHGetSetSettings(lpss, SSF_HIDEICONS, True);
end;
end;
end.
Aplicación Shot
Cualquier ayuda sería muy apreciada.
ACTUALIZACIÓN
Las barras de herramientas IDE ya no desaparecen, y el error no aparece ya, gracias a TOndrej para la información sobre cómo desactivar la barra de herramientas "Profiler". Ahora tengo un parpadeo muy molesto que a veces toma de 10 a 15 segundos para volver a la normalidad.
Le sugiero que pruebe el Delphi XE, si puede, se ve más estable. – none