Skip to content

Commit

Permalink
Fix crash when taskbar button interface is not available for some rea…
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarbecker committed Oct 24, 2016
1 parent 01ae878 commit 89508bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/main.pas
Expand Up @@ -1611,12 +1611,16 @@ procedure TMainForm.FormCreate(Sender: TObject);
FreeLibrary(NTHandle);

// Taskbar button interface for Windows 7
if CheckWin32Version(6, 1) then begin
// Possibly fails. See http://www.heidisql.com/forum.php?t=22451
if CheckWin32Version(6, 1) then
try
TaskbarList := CreateComObject(CLSID_TaskbarList) as ITaskbarList;
TaskbarList.HrInit;
Supports(TaskbarList, IID_ITaskbarList2, TaskbarList2);
Supports(TaskbarList, IID_ITaskbarList3, TaskbarList3);
Supports(TaskbarList, IID_ITaskbarList4, TaskbarList4);
except
on E:EOleSysError do;
end;

// Ensure directory exists
Expand Down

0 comments on commit 89508bc

Please sign in to comment.