1. Make all demo applications be able to record and restore the previous window geometry.
2. Improve the robustness of the widgets and quick implementation.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
1. Adds some more comments
2. Fixed a typo in QMainWindow example
3. Commented out a block of code that may cause issues
4. Return WVR_REDRAW by default in WM_NCCALCSIZE
5. Other minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
1. On Win11 we don't need to paint the frame border, the OS will always draw one for us.
2. Fix the wrong coordinate of the right and bottom frame border of the widget example.
3. Improve the Qt Quick example.
4. Correctly detect the OS version when building against Qt below 5.9.
5. Other minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
1. The QWinRegistryKey class was introduced in 5.14.0. The implementation is quite clean, so just copy the sources files from Qt repo in case the user is linking against a version older than 5.14.
2. Fixes the rounding error of the self-painted frame border of the examples.
3. Other minor tweaks.
Fixes: #95
Task-number: #94
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
1. Use native frame color in the MainWindow example, just like the Widget example. Fixes#87
2. Rename setHitTestVisibleInChrome() to setHitTestVisible(): This name was taken from Microsoft's WindowChrome class in WPF. Now they removed the legacy "Chrome" suffix in their new products, so we removed it as well.
3. Fix build with Qt older than 5.15: Q_NAMESPACE_EXPORT was introduced in Qt 5.14
4. Removed code that supports native frame: they are just leftovers of the previous refactoring.
4. Correctly detect SetWindowLongPtrW() and GetWindowLongPtrW() 's operation result: they won't modify the Last Error state on success, so we have to set Last Error state to ERROR_SUCCESS before calling them to make sure we get the correct error code.
5. Remove implicitly conversions, use explicit casts where possible
6. Fixed FormatMessage() usage, correctly retrieve the error message: According to MSDN, we should pass the address of a LPWSTR, not the LPWSTR itself.
7. Removed the special handing of WM_SIZE: It turns out that this handling is not needed at all and it's causing new issues, so just remove it.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>