你在这里运气不好,这个bug在QC 69533中报告过, 并在Delphi 2009的更新3中得到修复.
VCL用于验证文件是否为有效映像的代码,不检查快捷方式文件(.lnk),因此VCL认为该文件是有效映像并尝试加载该文件然后引发EInvalidGraphic例外.
只在调试器中引发异常,因为这样的代码用于检查验证文件名.
(仅显示部分实际代码,因为是VCL代码)
ValidPicture := FileExists(FullName) and ValidFile(FullName);
if ValidPicture then
try
// here try to load the file even if is a shortcut(.lnk)
except //this exception is caught by the debugger.
ValidPicture := False;
end;
Run Code Online (Sandbox Code Playgroud)
解决方法
1)您可以将EInvalidGraphic例外添加到 exceptions list to ignore列表中.

2)你可以写一个弯路(在这里你有一个样品),并实现自己的TOpenPictureDialog.DoSelectionChange方法(验证.lnk文件),因为正是在这些地方是由文件验证加载.
3)可以重写DoSelectionChange的方法TOpenPictureDialog使用插入器类,来验证文件中加载.
TOpenPictureDialog= class (ExtDlgs.TOpenPictureDialog)
procedure DoSelectionChange; override;
end;
Run Code Online (Sandbox Code Playgroud)