@@ -405,6 +405,51 @@ INT PhShowMessage_V(
405
405
return result ;
406
406
}
407
407
408
+ INT PhShowError2 (
409
+ _In_ HWND hWnd ,
410
+ _In_opt_ PWSTR Title ,
411
+ _In_opt_ PWSTR Message
412
+ )
413
+ {
414
+ if (TaskDialogIndirect_Import ())
415
+ {
416
+ INT button ;
417
+ TASKDIALOGCONFIG config = { sizeof (config ) };
418
+
419
+ config .hwndParent = hWnd ;
420
+ config .hInstance = PhLibImageBase ;
421
+ config .dwFlags = TDF_ALLOW_DIALOG_CANCELLATION | TDF_SIZE_TO_CONTENT | (IsWindowVisible (hWnd ) ? TDF_POSITION_RELATIVE_TO_WINDOW : 0 );
422
+ config .dwCommonButtons = TDCBF_CLOSE_BUTTON ;
423
+ config .pszWindowTitle = PhApplicationName ;
424
+ config .pszMainIcon = TD_ERROR_ICON ;
425
+ config .pszMainInstruction = Title ;
426
+ config .pszContent = Message ;
427
+
428
+ if (TaskDialogIndirect_Import ()(
429
+ & config ,
430
+ & button ,
431
+ NULL ,
432
+ NULL
433
+ ) == S_OK )
434
+ {
435
+ return button == IDCLOSE ;
436
+ }
437
+ else
438
+ {
439
+ return FALSE;
440
+ }
441
+ }
442
+ else
443
+ {
444
+ return PhShowMessage (
445
+ hWnd ,
446
+ MB_OK | MB_ICONERROR ,
447
+ Title ,
448
+ Message
449
+ ) == IDOK ;
450
+ }
451
+ }
452
+
408
453
PPH_STRING PhGetStatusMessage (
409
454
_In_ NTSTATUS Status ,
410
455
_In_opt_ ULONG Win32Result
@@ -468,7 +513,7 @@ VOID PhShowStatus(
468
513
469
514
if (Message )
470
515
{
471
- PhShowError (hWnd , L"%s: %s" , Message , statusMessage -> Buffer );
516
+ PhShowError2 (hWnd , Message , statusMessage -> Buffer );
472
517
}
473
518
else
474
519
{
@@ -517,7 +562,7 @@ BOOLEAN PhShowContinueStatus(
517
562
518
563
if (Message )
519
564
{
520
- result = PhShowMessage (hWnd , MB_ICONERROR | MB_OKCANCEL , L"%s: %s" , Message , statusMessage -> Buffer );
565
+ result = PhShowError2 (hWnd , Message , statusMessage -> Buffer );
521
566
}
522
567
else
523
568
{
0 commit comments