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.

Developer technologies | Windows Presentation Foundation
Developer technologies | C#
Developer technologies | 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.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.