A small example WPF app that shows how to call into clumsy Win32 APIs detect the window's monitor and refresh rate. Should also work easily for WinForms and UWP.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
RefreshRateWpfApp
.gitignore
README.md
RefreshRateWpfApp.sln

README.md

RefreshRateWpf

A small example WPF app that shows how to call into clumsy Win32 APIs detect the window's monitor and refresh rate. Should also work easily for WinForms and UWP, or even MFC. As long as you can get an HWND you should be able to do this.

See MainWindow.xaml.cs for the important bits of code.

This code goes along with this blog post: https://blog.getpaint.net/2017/08/12/win32-how-to-get-the-refresh-rate-for-a-window/