TemplateStudio icon indicating copy to clipboard operation
TemplateStudio copied to clipboard

TitleBarHelper still exists in 5.4

Open akshaybabloo opened this issue 1 year ago • 3 comments

Describe the bug

According to #4516 the helper should have been removed in 5.3 but I still see TitleBarHelper.cs file being created and used. Is this supposed to be still useful?

To Reproduce

Create a blank project

Additional context

No response

Applies to the following platforms:

  • [X] WinUI
  • [ ] WPF
  • [ ] UWP

About your setup

  • Visual Studio Version: 2022 Community
  • Template Studio Wizard Version: 5.4
  • Windows Build: Windows 10 Enterprise 19045.3208

akshaybabloo avatar Aug 14 '23 21:08 akshaybabloo

Yeah, it is ^^. For the 5.5 update (soon as I write this message ), it remains for the adaptation of the TitleBar with the new system introduced with the Windows App SDK 1.4.

https://github.com/microsoft/TemplateStudio/commit/52d63a4538c676bf97e0486a0df5d44b2cd4841a

Mysterious-Dev avatar Nov 10 '23 19:11 Mysterious-Dev

It seems that these function calls in TitleBarHelper are no longer necessary.

//var hwnd = WinRT.Interop.WindowNative.GetWindowHandle(App.MainWindow); //if (hwnd == GetActiveWindow()) //{ // SendMessage(hwnd, WMACTIVATE, WAINACTIVE, IntPtr.Zero); // SendMessage(hwnd, WMACTIVATE, WAACTIVE, IntPtr.Zero); //} //else //{ // SendMessage(hwnd, WMACTIVATE, WAACTIVE, IntPtr.Zero); // SendMessage(hwnd, WMACTIVATE, WAINACTIVE, IntPtr.Zero); //}

JoySurfer avatar Nov 15 '23 09:11 JoySurfer

how to get the 5.5 adapted code then on a solution based on 5.4?

smadep avatar Nov 20 '23 11:11 smadep