dotMorten / WinUIEx

WinUI Extensions
https://dotmorten.github.io/WinUIEx
MIT License
602 stars 38 forks source link

WindowMessageMonitor.NewWindowProc returns wrong results #18

Closed Balkoth closed 2 years ago

Balkoth commented 2 years ago

There are window messages where '0' means the message was handled, where you treat '0' as not handled and call DefSubclassProc(). For example if you do this with 'WM_DPICHANGED' you can crash the application.

A better way would be to introduce a boolean property Handled on WindowMessageEventArgs and only return the result when this is set to true.

dotMorten commented 2 years ago

Thanks! Implemented your suggestion.