Setting aero theme in wpf application with 4.8 .Net framework issue

Yasmin Jahid 1 Reputation point
2022-06-09T15:02:36.937+00:00

Hello team,

Getting exception .Net 4.8 framework at runtime while setting the aero theme in WPF application in below lines. Any help would be appreciated.

SystemResources_hwndNotifyHookField.SetValue(hookDelegate, null);

        var hwndNotify = SystemResources_hwndNotifyField.GetValue(hookDelegate);  
       var hwndNotifyValue = SecurityCriticalDataClass_ValueProperty.GetValue(null, hwndNotify);  
        HwndWrapper_AddHookMethod.Invoke(null, new object[] { hookDelegate })  

Please provide me equivalent code in 4.8 Framework. It works well with 4.6 framework.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,293 questions
{count} votes