MessageDlg shows information icon instead of confirmation

Viewed 9534

On Win 7, MessageDlg shows information icon instead of confirmation icon (question mark). Here is the code:

MessageDlg('Are you sure you want to delete this file?'+ CRLF+ FileName, mtConfirmation, [mbYes, mbNo], 0)= mrYes

What am I doing wrong?

3 Answers
if (Win32MajorVersion >= 6) and ThemeServices.ThemesEnabled then
    with TTaskDialog.Create(Self) do
      try
        Caption := 'Delete';
        Title := 'Are you sure to remove the minecraft?';
        Text := 'if you delete minecraft it well be gone forever.';
        CommonButtons := [tcbYes, tcbNo];
        CustomMainIcon.ReleaseHandle;
        CustomMainIcon.Handle := LoadIcon(0, IDI_QUESTION);
        Flags := [tfUseHiconMain];
        Execute;
      finally
        Free;
      end
  else
    MessageBox(Handle,
               'if you delete minecraft it well be gone forever.',
               'Are you sure to remove the minecraft?',
               MB_ICONQUESTION or MB_YESNO);
Related