At start, if an update is available, runtime packages are downloaded and replaced. If one of them is in use, a dialog window that allows users to retry or cancel is shown (Using MessageDlg). When the dialog is showing, no form has been created yet and the application icon isn't visible in the taskbar. I could create a custom dialog form and override the CreateParams procedure (As here Force application to show TaskBar Icon during OnCreate procedure), but I'm wondering if I can do the same thing using a standard dialog message.
Additional info: In cases which "(Win32MajorVersion >= 6) and UseLatestCommonDialogs and ThemeServices.ThemesEnabled" is False, MessageDlg creates the dialog as a TMessageForm (Inherited from TForm). If the condition results True, the following function's executed:
var
_TaskDialogIndirect: function(const pTaskConfig: TTaskDialogConfig;
pnButton: PInteger; pnRadioButton: PInteger;
pfVerificationFlagChecked: PBOOL): HRESULT; stdcall;
_TaskDialog: function(hwndParent: HWND; hInstance: HINST;
pszWindowTitle: LPCWSTR; pszMainInstruction: LPCWSTR; pszContent: LPCWSTR;
dwCommonButtons: DWORD; pszIcon: LPCWSTR; pnButton: PInteger): HRESULT; stdcall;
function TaskDialogIndirect(const pTaskConfig: TTaskDialogConfig;
pnButton: PInteger; pnRadioButton: PInteger; pfVerificationFlagChecked: PBOOL): HRESULT;
begin
if Assigned(_TaskDialogIndirect) then
Result := _TaskDialogIndirect(pTaskConfig, pnButton, pnRadioButton,
pfVerificationFlagChecked)
else
begin
InitComCtl;
Result := E_NOTIMPL;
if ComCtl32DLL <> 0 then
begin
@_TaskDialogIndirect := GetProcAddress(ComCtl32DLL, 'TaskDialogIndirect');
if Assigned(_TaskDialogIndirect) then
Result := _TaskDialogIndirect(pTaskConfig, pnButton, pnRadioButton,
pfVerificationFlagChecked)
end;
end;
end;