Screen ShotPerché questo errore continua a rovinare le barre degli strumenti IDE XE2?
Il seguente codice sorgente è stato utilizzato per produrre l'errore precedente. Tutto ciò che devi fare è compilare il programma e assicurarti che l'IDE sia ancora in esecuzione (l'errore NON si verifica se l'IDE è chiuso), fai clic sul pulsante da 12 a 15 volte e l'errore verrà visualizzato.
Una volta che si è verificato l'errore, tornare all'IDE, tutte le barre degli strumenti per l'IDE sono quindi scomparsi. Devi chiudere l'IDE e correre di nuovo, perché possano riapparire. Schermo
Source Code
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.
Applicazione americano
Qualsiasi aiuto sarebbe molto apprezzato.
UPDATE
Le barre degli strumenti IDE non scompaiono più, e l'errore non compare più, grazie alla TOndrej per le informazioni sulla disattivazione della "barra degli strumenti Profiler". Ora ho uno sfarfallio molto fastidioso che a volte richiede da 10 a 15 secondi per tornare alla normalità.
Ti suggerisco di provare il Delphi XE, se puoi, sembra più stabile. – none